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 --- 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,8 @@ assert(B::count == 0); assert(A::count == 0); +#ifdef _LIBCPP_VERSION // Bogus test cases assign unique_ptr to shared_ptr despite that + // Y* and T* are not compatible per [util.smartptr.shared.general]/6. { std::unique_ptr ptr(new A[8]); A* raw_ptr = ptr.get(); @@ -156,6 +158,7 @@ std::shared_ptr p; p = std::move(ptr); } +#endif // _LIBCPP_VERSION #if TEST_STD_VER > 14 { @@ -169,6 +172,8 @@ assert(A::count == 0); assert(B::count == 0); +#ifdef _LIBCPP_VERSION // Bogus test case assigns unique_ptr to shared_ptr despite that + // Y* and T* are not compatible per [util.smartptr.shared.general]/6. { std::unique_ptr ptr(new A[8]); A* raw_ptr = ptr.get(); @@ -182,6 +187,7 @@ } 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 --- 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,8 @@ } assert(A::count == 0); +#ifdef _LIBCPP_VERSION // Bogus test cases initialize shared_ptr with unique_ptr despite that + // Y* and T* are not compatible per [util.smartptr.shared.general]/6. { std::unique_ptr ptr(new A[8]); A* raw_ptr = ptr.get(); @@ -177,6 +179,7 @@ std::unique_ptr ptr(new int[8]); std::shared_ptr p(std::move(ptr)); } +#endif // _LIBCPP_VERSION #if TEST_STD_VER > 14 { @@ -189,6 +192,8 @@ assert(A::count == 0); assert(B::count == 0); +#ifdef _LIBCPP_VERSION // Bogus test case initializes shared_ptr with unique_ptr despite that + // Y* and T* are not compatible per [util.smartptr.shared.general]/6. { std::unique_ptr ptr(new A[8]); A* raw_ptr = ptr.get(); @@ -201,6 +206,7 @@ } assert(A::count == 0); assert(B::count == 0); +#endif // _LIBCPP_VERSION { std::unique_ptr ptr(new A[8]);