[PATCH] LWG 2996 add rvalue overloads for shared_ptr aliasing and casting

Jonathan Wakely jwakely@redhat.com
Fri May 24 13:00:00 GMT 2019


On 24/05/19 11:39 +0100, Jonathan Wakely wrote:
>On 24/05/19 11:02 +0200, Christophe Lyon wrote:
>>Hi Jonathan,
>>
>>On Thu, 23 May 2019 at 23:40, Jonathan Wakely <jwakely@redhat.com> wrote:
>>>
>>>        * doc/xml/manual/intro.xml: Document LWG DR 2996 change.
>>>        * doc/html/*: Regenerate.
>>>        * include/bits/shared_ptr.h (shared_ptr(shared_ptr&&, T*)): Add
>>>        rvalue aliasing constructor.
>>>        (static_pointer_cast, const_pointer, dynamic_pointer_cast)
>>>        (reinterpret_pointer_cast): Add overloads taking rvalues.
>>>        * include/bits/shared_ptr_base.h (__shared_ptr(__shared_ptr&&, T*)):
>>>        Add rvalue aliasing constructor.
>>>        * testsuite/20_util/shared_ptr/casts/1.cc: Change "compile" test to
>>>        "run" and check return values as well as types.
>>>        * testsuite/20_util/shared_ptr/casts/reinterpret.cc: Likewise.
>>>        * testsuite/20_util/shared_ptr/casts/rval.cc: New test.
>>>        * testsuite/20_util/shared_ptr/cons/alias-rval.cc: New test.
>>>        * testsuite/20_util/shared_ptr/cons/alias.cc: Remove unused return
>>>        values.
>>>
>>>Tested powerpc64le-linux, committed to trunk.
>>>
>>
>>As you may have noticed, the new test alias-rval.cc fails on arm and
>>aarch64, and other targets according to gcc-testresults@
>
>Yes, for some reason that test didn't run on the machine I tested on
>... not sure why. Fix coming shortly ...

Looks like I only half-finished writing that test, and then it didn't
get run. Here's a correct test, committed to trunk (and definitely
tested this time, on three systems).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 2315 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190524/5882d4fb/attachment.bin>


More information about the Libstdc++ mailing list