re PR libstdc++/58659 (Construction of shared_ptr from unique_ptr mismatches new...
authorJonathan Wakely <jwakely.gcc@gmail.com>
Tue, 8 Oct 2013 12:33:37 +0000 (12:33 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 8 Oct 2013 12:33:37 +0000 (13:33 +0100)
commit61bf02e007ceaaa81f92a9e10372303816955ba5
tree9ae99d30df85db39801dab11898c312ec74fccfe
parent481d1b81534c70122187f38c26d6a19db587528f
re PR libstdc++/58659 (Construction of shared_ptr from unique_ptr mismatches new/delete and std::allocator for __shared_ptr_count)

PR libstdc++/58659
* include/bits/shared_ptr_base.h (__shared_count::__shared_count(P,D)):
Delegate to constructor taking allocator.
(__shared_count::_S_create_from_up): Inline into ...
(__shared_count::__shared_count(unique_ptr<Y,D>&&): Here. Use
std::conditional instead of constrained overloads. Allocate memory
using the allocator type that will be used for deallocation.
* testsuite/20_util/shared_ptr/cons/58659.cc: New.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust.

From-SVN: r203274
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/shared_ptr_base.h
libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc
libstdc++-v3/testsuite/20_util/shared_ptr/cons/58659.cc [new file with mode: 0644]