[libcxx-commits] [libcxx] [libcxx][string] Test: default constructed allocators can be unequal (PR #195839)

Xavier Bonaventura via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jun 20 01:39:01 PDT 2026


================
@@ -36,7 +36,7 @@ TEST_CONSTEXPR_CXX20 void test(It first, It last) {
     ++it;
     ++i;
   }
-  assert(s2.get_allocator() == Alloc());
----------------
limdor wrote:

It would be good if some of the maintainers could tell what was the goal of this test in the first place.
I do not think that this checked was ever guaranteed by the standard with a generic allocator. Only if the `is_alway_equal` trait is true.
I wouls propose to not introduce a custom trait `are_default_allocators_always_equal` but just rely on the `is_always_equal` standard allocation trait.

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


More information about the libcxx-commits mailing list