diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-05-10 20:46:38 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-05-10 21:10:33 +0100 |
commit | 5edc0c15f1667cc2a5deb664b25c007b35d259f6 (patch) | |
tree | 8706dbce1d5b9ea547ba54e885d59fd25b76cb5c /gcc | |
parent | f974b54b8a0c330e9dd2b43ebc940100d601df0f (diff) | |
download | gcc-5edc0c15f1667cc2a5deb664b25c007b35d259f6.zip gcc-5edc0c15f1667cc2a5deb664b25c007b35d259f6.tar.gz gcc-5edc0c15f1667cc2a5deb664b25c007b35d259f6.tar.bz2 |
libstdc++: Implement proposed resolution to LWG 3548
This has been tentatively approved by LWG. The deleter from a unique_ptr
can be moved into the shared_ptr (at least, since LWG 2802). This uses
std::forward<_Del>(__r.get_deleter()) not std::move(__r.get_deleter())
because we don't want to convert the deleter to an rvalue when _Del is
an lvalue reference type.
This also adds a missing is_move_constructible_v<D> constraint to the
shared_ptr(unique_ptr<Y, D>&&) constructor, which is inherited from the
shared_ptr(Y*, D) constructor due to the use of "equivalent to" in the
specified effects.
libstdc++-v3/ChangeLog:
* include/bits/shared_ptr_base.h (__shared_count(unique_ptr&&)):
Initialize a non-reference deleter from an rvalue, as per LWG
3548.
(__shared_ptr::_UniqCompatible): Add missing constraint.
* testsuite/20_util/shared_ptr/cons/lwg3548.cc: New test.
* testsuite/20_util/shared_ptr/cons/unique_ptr_deleter.cc: Check
constraints.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions