[libc++] Qualify calls to nullary functions like __throw_foo (#122465)
This is technically not necessary in most cases to prevent issues with ADL,
but let's be consistent. This allows us to remove the libcpp-qualify-declval
clang-tidy check, which is now enforced by the robust-against-adl clang-tidy check.
diff --git a/libcxx/src/memory_resource.cpp b/libcxx/src/memory_resource.cpp
index ec9565f..22b5493 100644
--- a/libcxx/src/memory_resource.cpp
+++ b/libcxx/src/memory_resource.cpp
@@ -48,7 +48,7 @@
std::byte* result = std::__libcpp_allocate<std::byte>(__element_count(bytes), align);
if (!is_aligned_to(result, align)) {
std::__libcpp_deallocate<std::byte>(result, __element_count(bytes), align);
- __throw_bad_alloc();
+ std::__throw_bad_alloc();
}
return result;
#endif
@@ -64,7 +64,7 @@
// null_memory_resource()
class _LIBCPP_HIDDEN __null_memory_resource_imp : public memory_resource {
- void* do_allocate(size_t, size_t) override { __throw_bad_alloc(); }
+ void* do_allocate(size_t, size_t) override { std::__throw_bad_alloc(); }
void do_deallocate(void*, size_t, size_t) override {}
bool do_is_equal(const memory_resource& other) const noexcept override { return &other == this; }
};