+2009-03-14 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/39405
+ * include/std/type_traits (__add_lvalue_reference_helper,
+ __add_rvalue_reference_helper): Avoid is_function.
+ * testsuite/20_util/shared_ptr/cons/39405.cc: New.
+ * testsuite/tr1/2_general_utilities/shared_ptr/cons/39405.cc: Likewise.
+
2009-02-09 Johannes Singler <singler@ira.uka.de>
Backport from mainline:
// <type_traits> -*- C++ -*-
-// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009 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
{ typedef _Tp type; };
template<typename _Tp,
- bool = is_object<_Tp>::value || is_function<_Tp>::value,
+ bool = !is_reference<_Tp>::value && !is_void<_Tp>::value,
bool = is_rvalue_reference<_Tp>::value>
struct __add_lvalue_reference_helper
{ typedef _Tp type; };
{ };
template<typename _Tp,
- bool = is_object<_Tp>::value || is_function<_Tp>::value>
+ bool = !is_reference<_Tp>::value && !is_void<_Tp>::value>
struct __add_rvalue_reference_helper
{ typedef _Tp type; };
--- /dev/null
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009 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.
+
+#include <memory>
+
+// libstdc++/39405
+template<typename T>
+ struct foo
+ {
+ std::shared_ptr<foo<T> > m_foo;
+ };
+
+std::shared_ptr<foo<int> > t;
--- /dev/null
+// { dg-do compile }
+
+// Copyright (C) 2009 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.
+
+#include <tr1/memory>
+
+// libstdc++/39405
+template<typename T>
+ struct foo
+ {
+ std::tr1::shared_ptr<foo<T> > m_foo;
+ };
+
+std::tr1::shared_ptr<foo<int> > t;