[libcxx-commits] [libcxx] [libc++] LWG 3821 uses_allocator_construction_args should have overload for pair-like (PR #66939)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 27 09:17:18 PDT 2023


================
@@ -132,19 +133,48 @@ constexpr bool test() {
   }
 #endif
   {
-    ConvertibleToPair ctp {};
-    auto ret = test_uses_allocator_construction_args<std::pair<int, int>>(a, ctp);
+    ConvertibleToPair ctp{};
+    auto ret              = test_uses_allocator_construction_args<std::pair<int, int>>(a, ctp);
     std::pair<int, int> v = std::get<0>(ret);
     assert(std::get<0>(v) == 1);
     assert(std::get<1>(v) == 2);
   }
   {
-    ConvertibleToPair ctp {};
-    auto ret = test_uses_allocator_construction_args<std::pair<int, int>>(a, std::move(ctp));
+    ConvertibleToPair ctp{};
+    auto ret              = test_uses_allocator_construction_args<std::pair<int, int>>(a, std::move(ctp));
     std::pair<int, int> v = std::get<0>(ret);
     assert(std::get<0>(v) == 1);
     assert(std::get<1>(v) == 2);
   }
+#if TEST_STD_VER >= 23
+  // LWG 3821
----------------
ldionne wrote:

Let's change the comment to

```
// P2165R4 with LWG3821 applied
```

This makes it clearer why we're only testing in C++23 mode.

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


More information about the libcxx-commits mailing list