diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter.pass.cpp
@@ -28,6 +28,9 @@
int A::count = 0;
+struct Base { };
+struct Derived : Base { };
+
int main(int, char**)
{
{
@@ -46,5 +49,11 @@
assert(test_deleter::count == 0);
assert(test_deleter::dealloc_count == 1);
+ {
+ // Make sure that we can construct a shared_ptr where the element type and pointer type
+ // aren't "convertible" but are "compatible".
+ static_assert(!std::is_constructible, Base[4], test_deleter >::value, "");
+ }
+
return 0;
}
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_allocator.pass.cpp
@@ -28,6 +28,8 @@
int A::count = 0;
+struct Base { };
+struct Derived : Base { };
int main(int, char**)
{
@@ -87,5 +89,13 @@
assert(test_deleter::dealloc_count == 1);
#endif
+ {
+ // Make sure that we can construct a shared_ptr where the element type and pointer type
+ // aren't "convertible" but are "compatible".
+ static_assert(!std::is_constructible,
+ Base[4], test_deleter,
+ test_allocator >::value, "");
+ }
+
return 0;
}