[libcxx-commits] [libcxx] 89bcac0 - Revert "[libc++] Add minor test for polymorphic_allocator.construct with mixed argument pair"

Haowei Wu via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 29 17:08:05 PDT 2023


Author: Haowei Wu
Date: 2023-03-29T17:07:31-07:00
New Revision: 89bcac0f8fb098e32c4b5f192bd2d2997d8ee9cf

URL: https://github.com/llvm/llvm-project/commit/89bcac0f8fb098e32c4b5f192bd2d2997d8ee9cf
DIFF: https://github.com/llvm/llvm-project/commit/89bcac0f8fb098e32c4b5f192bd2d2997d8ee9cf.diff

LOG: Revert "[libc++] Add minor test for polymorphic_allocator.construct with mixed argument pair"

This reverts commit b66a6e4b104b245ed448e3dea944fa7e842a96b2 which
breaks runtime tests.

Added: 
    

Modified: 
    libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp
index 75bfe6f97da72..4677bf00f1958 100644
--- a/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp
+++ b/libcxx/test/std/utilities/utility/mem.res/mem.poly.allocator.class/mem.poly.allocator.mem/construct_pair.pass.cpp
@@ -25,16 +25,15 @@
 
 int constructed = 0;
 
-template <int>
 struct default_constructible {
   default_constructible() : x(42) { ++constructed; }
   int x = 0;
 };
 
 int main(int, char**) {
-  // pair<default_constructible, default_constructible>
+  // pair<default_constructible, default_constructible> as T()
   {
-    typedef default_constructible<0> T;
+    typedef default_constructible T;
     typedef std::pair<T, T> P;
     typedef std::pmr::polymorphic_allocator<void> A;
     alignas(P) char buffer[sizeof(P)];
@@ -46,20 +45,5 @@ int main(int, char**) {
     assert(ptr->second.x == 42);
   }
 
-  // pair<default_constructible<0>, default_constructible<1>>
-  {
-    typedef default_constructible<0> T;
-    typedef default_constructible<1> U;
-    typedef std::pair<T, U> P;
-    typedef std::pmr::polymorphic_allocator<void> A;
-    alignas(P) char buffer[sizeof(P)];
-    P* ptr = reinterpret_cast<P*>(buffer);
-    A a;
-    a.construct(ptr);
-    assert(constructed == 2);
-    assert(ptr->first.x == 42);
-    assert(ptr->second.x == 42);
-  }
-
   return 0;
 }


        


More information about the libcxx-commits mailing list