diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-28 23:28:16 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-28 23:28:16 +0000 |
commit | 2807553e8400a5e0ac08a8b86ea589b08b10a220 (patch) | |
tree | 20cc65da4d739c33baa9749eba0954a635aa7c36 /libstdc++-v3/testsuite/20_util/shared_ptr/creation/36949.cc | |
parent | 644c6d4c1622cda8b9ca8b63e1f3f91de7c920a9 (diff) | |
download | gcc-2807553e8400a5e0ac08a8b86ea589b08b10a220.tar.gz |
2008-07-28 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/36949
* include/tr1_impl/boost_shared_ptr.h
(__shared_ptr(_Sp_make_shared_tag, _Alloc, _Args&&...): Call
__enable_shared_from_this_helper.
* testsuite/20_util/shared_ptr/creation/36949.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138219 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/20_util/shared_ptr/creation/36949.cc')
-rw-r--r-- | libstdc++-v3/testsuite/20_util/shared_ptr/creation/36949.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/creation/36949.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/creation/36949.cc new file mode 100644 index 00000000000..4fc7db3a610 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/creation/36949.cc @@ -0,0 +1,35 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +#include <memory> + +struct A : std::enable_shared_from_this<A> { }; + +// libstdc++/36949 +void test01() +{ + std::make_shared<A>()->shared_from_this(); +} + +int main() +{ + test01(); + return 0; +} |