LWG 2996 add rvalue overloads for shared_ptr aliasing and casting

Programming / Compilers / GCC - redi [138bc75d-0d04-0410-961f-82ee72b054a4] - 23 May 2019 21:41 EDT

- 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.

a00d36cdbef LWG 2996 add rvalue overloads for shared_ptr aliasing and casting
libstdc++-v3/ChangeLog | 16 ++++
libstdc++-v3/doc/html/manual/api.html | 3 +
libstdc++-v3/doc/html/manual/bugs.html | 10 ++
libstdc++-v3/doc/xml/manual/intro.xml | 8 ++
libstdc++-v3/include/bits/shared_ptr.h | 93 +++++++++++++++++--
libstdc++-v3/include/bits/shared_ptr_base.h | 11 +++
.../testsuite/20_util/shared_ptr/casts/1.cc | 55 ++++++++++-
.../20_util/shared_ptr/casts/reinterpret.cc | 33 ++++++-
.../testsuite/20_util/shared_ptr/casts/rval.cc | 101 +++++++++++++++++++++
.../20_util/shared_ptr/cons/alias-rval.cc | 101 +++++++++++++++++++++
.../testsuite/20_util/shared_ptr/cons/alias.cc | 14 +--
11 files changed, 416 insertions(+), 29 deletions(-)

Upstream: gcc.gnu.org


  • Share