From: Jonathan Wakely Date: Sun, 14 Oct 2007 17:40:50 +0000 (+0000) Subject: boost_shared_ptr.h: (__weak_ptr::lock()): Add missing template argument. X-Git-Tag: prereleases/gcc-4.2.3-rc1~187 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef0c87b6f8a278918ad9bc899a7b85f5da6a5c2f;p=thirdparty%2Fgcc.git boost_shared_ptr.h: (__weak_ptr::lock()): Add missing template argument. * include/tr1_impl/boost_shared_ptr.h: (__weak_ptr::lock()): Add missing template argument. * testsuite/tr1/2_general_utilities/memory/shared_ptr/ explicit_instantiation/2.cc: New. * testsuite/tr1/2_general_utilities/memory/weak_ptr/ explicit_instantiation/2.cc: New. From-SVN: r129297 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 72fb22791bcb..5e8d9b390eb2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2007-10-14 Jonathan Wakely + + * include/tr1_impl/boost_shared_ptr.h: (__weak_ptr::lock()): Add + missing template argument. + * testsuite/tr1/2_general_utilities/memory/shared_ptr/ + explicit_instantiation/2.cc: New. + * testsuite/tr1/2_general_utilities/memory/weak_ptr/ + explicit_instantiation/2.cc: New. + 2007-10-11 Paolo Carlini PR libstdc++/33734 diff --git a/libstdc++-v3/include/tr1/boost_shared_ptr.h b/libstdc++-v3/include/tr1/boost_shared_ptr.h index fc79cfc70c23..d83bde692a61 100644 --- a/libstdc++-v3/include/tr1/boost_shared_ptr.h +++ b/libstdc++-v3/include/tr1/boost_shared_ptr.h @@ -857,7 +857,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) // Q: How can we get here? // A: Another thread may have invalidated r after the // use_count test above. - return __shared_ptr(); + return __shared_ptr(); } #else diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/explicit_instantiation/2.cc new file mode 100644 index 000000000000..0d4839c98712 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/explicit_instantiation/2.cc @@ -0,0 +1,34 @@ +// Copyright (C) 2007 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. + +// TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared] + +#include +#include + +// { dg-do compile } + +// Check the _S_single lock policy can be instantiated. For a thread-enabled +// library this checks the templates can be instantiated for non-default +// lock policy, for a single-threaded lib this is redundant but harmless. +using namespace __gnu_test; +using std::tr1::__shared_ptr; +using std::tr1::_S_single; +template class __shared_ptr; +template class __shared_ptr; +template class __shared_ptr; diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/weak_ptr/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/weak_ptr/explicit_instantiation/2.cc new file mode 100644 index 000000000000..567f3489c239 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/weak_ptr/explicit_instantiation/2.cc @@ -0,0 +1,35 @@ +// Copyright (C) 2007 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. + +// TR1 2.2.4 Template class weak_ptr [tr.util.smartptr.weak] + +#include +#include + +// { dg-do compile } + +// Check the _S_single lock policy can be instantiated. For a thread-enabled +// library this checks the templates can be instantiated for non-default +// lock policy, for a single-threaded lib this is redundant but harmless. +using namespace __gnu_test; +using std::tr1::__weak_ptr; +using std::tr1::_S_single; +template class __weak_ptr; +template class __weak_ptr; +template class __weak_ptr; +template class __weak_ptr;