* include/bits/shared_ptr_base.h (__cpp_lib_enable_shared_from_this):
Define feature-test macro.
* testsuite/20_util/enable_shared_from_this/members/reinit.cc: Test
for the macro.
From-SVN: r239094
2016-08-03 Jonathan Wakely <jwakely@redhat.com>
+ * include/bits/shared_ptr_base.h (__cpp_lib_enable_shared_from_this):
+ Define feature-test macro.
+ * testsuite/20_util/enable_shared_from_this/members/reinit.cc: Test
+ for the macro.
+
* include/bits/shared_ptr.h (shared_ptr::weak_type): Define.
* include/bits/shared_ptr_base.h (__shared_ptr::weak_type): Define.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error.
void
_M_assign(_Tp* __ptr, const __shared_count<_Lp>& __refcount) noexcept
{
+#define __cpp_lib_enable_shared_from_this 201603
if (use_count() == 0)
{
_M_ptr = __ptr;
#include <memory>
#include <testsuite_hooks.h>
+#if __cpp_lib_enable_shared_from_this < 201603
+# error "__cpp_lib_enable_shared_from_this < 201603"
+#endif
+
struct X : public std::enable_shared_from_this<X> { };
bool