__shared_ptr<_Tp, _Lp>
lock() const noexcept
- { return __shared_ptr<element_type, _Lp>(*this, std::nothrow); }
+ { return __shared_ptr<_Tp, _Lp>(*this, std::nothrow); }
long
use_count() const noexcept
--- /dev/null
+// { dg-do compile { target c++11 } }
+// { dg-require-effective-target hosted }
+
+#include <memory>
+#include <testsuite_tr1.h>
+
+using namespace __gnu_test;
+
+void
+test01()
+{
+ std::shared_ptr<ClassType> ptr;
+ std::shared_ptr<const ClassType> ptr2 = ptr;
+
+#if __cpp_lib_shared_ptr_arrays >= 201611L
+ std::shared_ptr<ClassType[10]> ptr_array;
+ std::shared_ptr<ClassType[]> ptr_array2 = ptr_array;
+ std::shared_ptr<ClassType const []> ptr_array3 = ptr_array;
+#endif
+}
+
+void
+test02()
+{
+ std::shared_ptr<IncompleteClass> ptr;
+ std::shared_ptr<const IncompleteClass> ptr2 = ptr;
+
+#if __cpp_lib_shared_ptr_arrays >= 201611L
+ std::shared_ptr<IncompleteClass[10]> ptr_array;
+ std::shared_ptr<IncompleteClass[]> ptr_array2 = ptr_array;
+ std::shared_ptr<IncompleteClass const []> ptr_array3 = ptr_array;
+#endif
+}
template class std::shared_ptr<void>;
template class std::shared_ptr<ClassType>;
template class std::shared_ptr<IncompleteClass>;
+
+#if __cpp_lib_shared_ptr_arrays >= 201611L
+template class std::shared_ptr<ClassType []>;
+template class std::shared_ptr<ClassType [42]>;
+template class std::shared_ptr<ClassType const []>;
+template class std::shared_ptr<ClassType const [42]>;
+
+template class std::shared_ptr<IncompleteClass []>;
+template class std::shared_ptr<IncompleteClass [42]>;
+template class std::shared_ptr<IncompleteClass const []>;
+template class std::shared_ptr<IncompleteClass const [42]>;
+#endif
--- /dev/null
+// { dg-do compile { target c++11 } }
+// { dg-require-effective-target hosted }
+
+#include <memory>
+#include <testsuite_tr1.h>
+
+using namespace __gnu_test;
+
+void
+test01()
+{
+ std::weak_ptr<ClassType> ptr;
+ std::weak_ptr<const ClassType> ptr2 = ptr;
+
+#if __cpp_lib_shared_ptr_arrays >= 201611L
+ std::weak_ptr<ClassType[10]> ptr_array;
+ std::weak_ptr<ClassType[]> ptr_array2 = ptr_array;
+ std::weak_ptr<ClassType const []> ptr_array3 = ptr_array;
+#endif
+}
+
+void
+test02()
+{
+ std::weak_ptr<IncompleteClass> ptr;
+ std::weak_ptr<const IncompleteClass> ptr2 = ptr;
+
+#if __cpp_lib_shared_ptr_arrays >= 201611L
+ std::weak_ptr<IncompleteClass[10]> ptr_array;
+ std::weak_ptr<IncompleteClass[]> ptr_array2 = ptr_array;
+ std::weak_ptr<IncompleteClass const []> ptr_array3 = ptr_array;
+#endif
+}
template class std::weak_ptr<void>;
template class std::weak_ptr<ClassType>;
template class std::weak_ptr<IncompleteClass>;
+
+#if __cpp_lib_shared_ptr_arrays >= 201611L
+template class std::weak_ptr<ClassType []>;
+template class std::weak_ptr<ClassType [42]>;
+template class std::weak_ptr<ClassType const []>;
+template class std::weak_ptr<ClassType const [42]>;
+
+template class std::weak_ptr<IncompleteClass []>;
+template class std::weak_ptr<IncompleteClass [42]>;
+template class std::weak_ptr<IncompleteClass const []>;
+template class std::weak_ptr<IncompleteClass const [42]>;
+#endif