[libcxx-commits] [libcxx] [libc++][test] Fix construction and comparison for testing allocators (PR #212702)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 30 07:56:40 PDT 2026


================
@@ -65,8 +71,14 @@ class no_default_allocator {
 
   TEST_CONSTEXPR_CXX20 void deallocate(T* p, std::size_t n) { std::allocator<T>().deallocate(p, n); }
 
-  friend TEST_CONSTEXPR bool operator==(no_default_allocator, no_default_allocator) { return true; }
-  friend TEST_CONSTEXPR bool operator!=(no_default_allocator x, no_default_allocator y) { return !(x == y); }
+  template <class U>
+  friend TEST_CONSTEXPR bool operator==(no_default_allocator, no_default_allocator<U>) {
----------------
ldionne wrote:

Can we perhaps define those functions symmetrically (as free functions) with `<class T, class U>` instead?

https://github.com/llvm/llvm-project/pull/212702


More information about the libcxx-commits mailing list