]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
boost_shared_ptr.h: (__weak_ptr::lock()): Add missing template argument.
authorJonathan Wakely <jwakely.gcc@gmail.com>
Fri, 14 Sep 2007 20:17:29 +0000 (20:17 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 14 Sep 2007 20:17:29 +0000 (21:17 +0100)
2007-09-14  Jonathan Wakely  <jwakely.gcc@gmail.com>

* 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
libstdc++-v3/include/tr1_impl/boost_shared_ptr.h
libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/requirements/explicit_instantiation/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/weak_ptr/requirements/explicit_instantiation/2.cc [new file with mode: 0644]

index 3dcfc2115e66890bbfae89dc2786f46e2e5a153e..ef0c0e12e8ad6b08ed5aff64a5c842f89ae0d17c 100644 (file)
@@ -1,3 +1,12 @@
+2007-09-10  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       * 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  <bkoz@redhat.com>
 
        * testsuite/17_intro/headers/all_pedantic_errors.cc: New.
index d211055c58ad34948f7ae2abfba5b69d88f27414..e3d8827b65d5cc0a5573c20ae60f4fa869c52b69 100644 (file)
@@ -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<element_type>();
+           return __shared_ptr<element_type, _Lp>();
          }
        
 #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 (file)
index 0000000..0d4839c
--- /dev/null
@@ -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 <tr1/memory>
+#include <testsuite_tr1.h>
+
+// { 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<int, _S_single>;
+template class __shared_ptr<ClassType, _S_single>;
+template class __shared_ptr<IncompleteClass, _S_single>;
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 (file)
index 0000000..567f348
--- /dev/null
@@ -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 <tr1/memory>
+#include <testsuite_tr1.h>
+
+// { 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<int, _S_single>;
+template class __weak_ptr<void, _S_single>;
+template class __weak_ptr<ClassType, _S_single>;
+template class __weak_ptr<IncompleteClass, _S_single>;