From fb3fc4bded8d934b603a7f07ab3cfe3b644ee971 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
Date: Thu, 23 May 2019 22:41:02 +0100
Subject: [PATCH] LWG 2996 add rvalue overloads for shared_ptr aliasing and
casting
* 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.
From-SVN: r271583
---
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 +++++-
.../20_util/shared_ptr/casts/rval.cc | 101 ++++++++++++++++++
.../20_util/shared_ptr/cons/alias-rval.cc | 101 ++++++++++++++++++
.../20_util/shared_ptr/cons/alias.cc | 14 +--
11 files changed, 416 insertions(+), 29 deletions(-)
create mode 100644 libstdc++-v3/testsuite/20_util/shared_ptr/casts/rval.cc
create mode 100644 libstdc++-v3/testsuite/20_util/shared_ptr/cons/alias-rval.cc
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index e230f24ca13..48b519e9cd0 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,21 @@
2019-05-23 Jonathan Wakely
+ * 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.
+
* doc/xml/manual/evolution.xml: Document LWG DR 2921 change.
* doc/xml/manual/intro.xml: Likewise.
* include/std/future (__create_task_state): Add default arguments
diff --git a/libstdc++-v3/doc/html/manual/api.html b/libstdc++-v3/doc/html/manual/api.html
index bb131d3010c..345c58802a4 100644
--- a/libstdc++-v3/doc/html/manual/api.html
+++ b/libstdc++-v3/doc/html/manual/api.html
@@ -393,4 +393,7 @@ now defaults to zero.
<experimental/timer>
.
Deprecated features removed:
- Profile Mode
__gnu_cxx::array_allocator
+
+ The std::packaged_task
constructors taking
+ an allocator argument are only defined for C++11 and C++14.