[PATCH] Define feature-test macro for std::enable_shared_from_this

Jonathan Wakely jwakely@redhat.com
Wed Aug 31 16:57:00 GMT 2016


On 04/08/16 13:33 +0100, Jonathan Wakely wrote:
>On 03/08/16 20:11 +0100, Jonathan Wakely wrote:
>>Another feature we already support, so just define the macro.
>>
>>	* 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.
>>
>>Tested x86_64-linux, committed to trunk.
>
>I realised we don't actually implement the whole feature, because we
>don't have the new weak_from_this() members (careless of me to forget
>the contents of my own proposal!)
>
>This adds them for C++17, or gnu++1*, and only defines the
>feature-test macro when those members are present.
>
>Tested powerpc64-linux, committed to trunk.
>
>

>commit 7c1f28db94c3cb1a28dba4efd0c648bc6c6bb329
>Author: Jonathan Wakely <jwakely@redhat.com>
>Date:   Thu Aug 4 13:04:14 2016 +0100
>
>    Define std::enable_shared_from_this::weak_from_this
>    
>    	* testsuite/20_util/enable_shared_from_this/members/reinit.cc: Use
>    	effective target not dg-options. Move check for feature-test macro to:
>    	* testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc:
>    	New test.

I made a mess of this commit, failing to add shared_ptr.h and
shared_ptr_base.h to the ChangeLog, and failing to commit the new
test!

This adds the missing test.

Tested powerpc64le-linux, committed to trunk.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1945 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160831/98b5710d/attachment.bin>


More information about the Gcc-patches mailing list