]> 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>
Sun, 14 Oct 2007 17:40:50 +0000 (17:40 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Sun, 14 Oct 2007 17:40:50 +0000 (18:40 +0100)
* 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

libstdc++-v3/ChangeLog
libstdc++-v3/include/tr1/boost_shared_ptr.h
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/explicit_instantiation/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/tr1/2_general_utilities/memory/weak_ptr/explicit_instantiation/2.cc [new file with mode: 0644]

index 72fb22791bcbd944aa081417c44887bad4618c01..5e8d9b390eb2e2203c8d1c7318c1d162fe5a34f6 100644 (file)
@@ -1,3 +1,12 @@
+2007-10-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/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  <pcarlini@suse.de>
 
        PR libstdc++/33734
index fc79cfc70c2358e5e35659dbb9f0b570bc014f5b..d83bde692a618f6548c7a659b92c5605b658e468 100644 (file)
@@ -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<element_type>();
+           return __shared_ptr<element_type, _Lp>();
          }
        
 #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 (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/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 (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>;