From: Casey Carter Date: Thu, 30 Dec 2021 00:02:45 +0000 (-0800) Subject: [libcxx][test] Disable bad unique_ptr to shared_ptr conversion test cases X-Git-Tag: upstream/15.0.7~17289 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0dcb370d43012a25f28295010ec3e8d3362e3e52;p=platform%2Fupstream%2Fllvm.git [libcxx][test] Disable bad unique_ptr to shared_ptr conversion test cases 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 --- diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp index f9e1798..3063e77 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.assign/unique_ptr_Y.pass.cpp @@ -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 ptr(new A[8]); A* raw_ptr = ptr.get(); @@ -156,6 +157,7 @@ int main(int, char**) std::shared_ptr 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 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 ptr(new A[8]); diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp index ad88a3e..ef0b910 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp @@ -149,6 +149,7 @@ int main(int, char**) } assert(A::count == 0); +#ifdef _LIBCPP_VERSION // https://llvm.org/PR53368 { std::unique_ptr ptr(new A[8]); A* raw_ptr = ptr.get(); @@ -177,6 +178,7 @@ int main(int, char**) std::unique_ptr ptr(new int[8]); std::shared_ptr 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 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 ptr(new A[8]);