Commit c7fdbdcd by Jonathan Wakely Committed by Jonathan Wakely

Define feature-test macro for std::enable_shared_from_this

	* 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
parent f21f4463
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.
......
......@@ -1472,6 +1472,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
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;
......
......@@ -20,6 +20,10 @@
#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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment