[libcxx-commits] [libcxx] [libc++][test] Fix issues found by MSVC's STL (PR #131787)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 24 23:18:07 PDT 2025


================
@@ -71,7 +71,7 @@ TEST_CONSTEXPR_CXX20 bool tests() {
   // Test with various allocators and different `size_type`s
   {
     test(std::vector<bool>());
-    test(std::vector<bool, std::allocator<int> >());
+    test(std::vector<bool, std::allocator<bool> >());
----------------
philnik777 wrote:

I'm definitely in favour of requiring that the allocator type is the same as the container's `value_type`. Anything else is almost certainly a user error. This also allows us to rebind to the `value_type` and make sure that the allocator stays the same, which has found numerous bugs already.

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


More information about the libcxx-commits mailing list