[libcxx][test] Disable bad unique_ptr<T[]> to shared_ptr<U[]> conversion test cases
authorCasey Carter <Casey@Carter.net>
Thu, 30 Dec 2021 00:02:45 +0000 (16:02 -0800)
committerCasey Carter <Casey@Carter.net>
Tue, 8 Feb 2022 22:56:47 +0000 (14:56 -0800)
for non-libc++. I've reported allowance of these conversions as a bug at https://llvm.org/PR53368.

Differential Revision: https://reviews.llvm.org/D117996

libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp

index f9e1798..3063e77 100644 (file)
@@ -125,6 +125,7 @@ int main(int, char**)
     assert(B::count == 0);
     assert(A::count == 0);
 
+#ifdef _LIBCPP_VERSION // https://llvm.org/PR53368
     {
       std::unique_ptr<A[]> ptr(new A[8]);
       A* raw_ptr = ptr.get();
@@ -156,6 +157,7 @@ int main(int, char**)
       std::shared_ptr<int> p;
       p = std::move(ptr);
     }
+#endif // _LIBCPP_VERSION
 
 #if TEST_STD_VER > 14
     {
@@ -169,6 +171,7 @@ int main(int, char**)
     assert(A::count == 0);
     assert(B::count == 0);
 
+#ifdef _LIBCPP_VERSION // https://llvm.org/PR53368
     {
       std::unique_ptr<A[]> ptr(new A[8]);
       A* raw_ptr = ptr.get();
@@ -182,6 +185,7 @@ int main(int, char**)
     }
     assert(A::count == 0);
     assert(B::count == 0);
+#endif // _LIBCPP_VERSION
 
     {
       std::unique_ptr<A[]> ptr(new A[8]);
index ad88a3e..ef0b910 100644 (file)
@@ -149,6 +149,7 @@ int main(int, char**)
     }
 
     assert(A::count == 0);
+#ifdef _LIBCPP_VERSION // https://llvm.org/PR53368
     {
       std::unique_ptr<A[]> ptr(new A[8]);
       A* raw_ptr = ptr.get();
@@ -177,6 +178,7 @@ int main(int, char**)
       std::unique_ptr<int[]> ptr(new int[8]);
       std::shared_ptr<int> p(std::move(ptr));
     }
+#endif // _LIBCPP_VERSION
 
 #if TEST_STD_VER > 14
     {
@@ -189,6 +191,7 @@ int main(int, char**)
     assert(A::count == 0);
     assert(B::count == 0);
 
+#ifdef _LIBCPP_VERSION // https://llvm.org/PR53368
     {
       std::unique_ptr<A[]> ptr(new A[8]);
       A* raw_ptr = ptr.get();
@@ -201,6 +204,7 @@ int main(int, char**)
     }
     assert(A::count == 0);
     assert(B::count == 0);
+#endif // _LIBCPP_VERSION
 
     {
       std::unique_ptr<A[]> ptr(new A[8]);