This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] libstdc++/61036 - fix dumb typo in shared_ptr

This was a really dumb regression from me :-(

Tested x86_64-linux, committed to trunk and 4.9 branch.

commit 892be9bd861871e39049c78c75807f5680fffb94
Author: Jonathan Wakely <>
Date:   Fri May 2 18:35:41 2014 +0100

    	PR libstdc++/61036
    	* include/bits/shared_ptr_base.h (__shared_ptr::__shared_ptr(_Tp1*)):
    	Check the correct type in the static assertion.
    	* testsuite/20_util/shared_ptr/cons/ New.

diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index 57398af..c25157f 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
         : _M_ptr(__p), _M_refcount(__p)
 	  __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>)
-	  static_assert( !is_void<_Tp>::value, "incomplete type" );
+	  static_assert( !is_void<_Tp1>::value, "incomplete type" );
 	  static_assert( sizeof(_Tp1) > 0, "incomplete type" );
 	  __enable_shared_from_this_helper(_M_refcount, __p, __p);
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/
new file mode 100644
index 0000000..9cade66
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/
@@ -0,0 +1,28 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+// Copyright (C) 2014 Free Software Foundation, Inc.
+// 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 3, 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
+// 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 COPYING3.  If not see
+// <>.
+// Template class shared_ptr [util.smartptr.shared]
+#include <memory>
+void test01()
+  std::shared_ptr<void> p(new int);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]