From e31fc6a53150ed4b22314913c5768dae0895263c Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 14 Sep 2007 20:17:29 +0000 Subject: [PATCH] boost_shared_ptr.h: (__weak_ptr::lock()): Add missing template argument. 2007-09-14 Jonathan Wakely * include/tr1_impl/boost_shared_ptr.h: (__weak_ptr::lock()): Add missing template argument. * testsuite/tr1/2_general_utilities/shared_ptr/requirements/ explicit_instantiation/2.cc: New. * testsuite/tr1/2_general_utilities/weak_ptr/requirements/ explicit_instantiation/2.cc: New. From-SVN: r128503 --- libstdc++-v3/ChangeLog | 9 +++++ .../include/tr1_impl/boost_shared_ptr.h | 2 +- .../requirements/explicit_instantiation/2.cc | 34 ++++++++++++++++++ .../requirements/explicit_instantiation/2.cc | 35 +++++++++++++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/2.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3dcfc2115e6..ef0c0e12e8a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2007-09-10 Jonathan Wakely + + * include/tr1_impl/boost_shared_ptr.h: (__weak_ptr::lock()): Add + missing template argument. + * testsuite/tr1/2_general_utilities/shared_ptr/requirements/ + explicit_instantiation/2.cc: New. + * testsuite/tr1/2_general_utilities/weak_ptr/requirements/ + explicit_instantiation/2.cc: New. + 2007-09-14 Benjamin Kosnik * testsuite/17_intro/headers/all_pedantic_errors.cc: New. diff --git a/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h b/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h index d211055c58a..e3d8827b65d 100644 --- a/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h +++ b/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h @@ -856,7 +856,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/shared_ptr/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/2.cc new file mode 100644 index 00000000000..0d4839c9871 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/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/weak_ptr/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/2.cc new file mode 100644 index 00000000000..567f3489c23 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/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;