Only set std::enable_shared_from_this member once.
authorJonathan Wakely <jwakely@redhat.com>
Wed, 26 Aug 2015 21:27:00 +0000 (22:27 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 26 Aug 2015 21:27:00 +0000 (22:27 +0100)
commit6bc41b268ea0e16e001f73a9760a9c847c6aa87c
treee4feb4c92083ee17de6031c8d6d5b2b72e0a6265
parent2d1a0c68abef1179cc7b471ec566c0b41025ab57
Only set std::enable_shared_from_this member once.

* include/bits/shared_ptr.h (__enable_shared_from_this_helper): Use
nullptr.
* include/bits/shared_ptr_base.h (weak_ptr::_M_assign): Don't assign
if ownership is already shared with a shared_ptr object.
(__enable_shared_from_this_helper): Use nullptr.
* testsuite/20_util/enable_shared_from_this/members/const.cc: New.
* testsuite/20_util/enable_shared_from_this/members/reinit.cc: New.
* testsuite/20_util/enable_shared_from_this/requirements/
explicit_instantiation.cc: Instantiate with const and incomplete types.

From-SVN: r227232
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/shared_ptr.h
libstdc++-v3/include/bits/shared_ptr_base.h
libstdc++-v3/testsuite/20_util/enable_shared_from_this/members/const.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/enable_shared_from_this/members/reinit.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/enable_shared_from_this/requirements/explicit_instantiation.cc