mirror of git://gcc.gnu.org/git/gcc.git
re PR libstdc++/35637 (tr1::function fails with const member function pointer)
2008-03-20 Paolo Carlini <pcarlini@suse.de> PR libstdc++/35637 * include/tr1_impl/type_traits (struct __in_array): Add back. (is_function): Use it. * testsuite/tr1/4_metaprogramming/is_function/35637.cc: New. From-SVN: r133395
This commit is contained in:
parent
433d52fd43
commit
33c8c0b69c
|
|
@ -1,7 +1,13 @@
|
||||||
|
2008-03-20 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
|
||||||
|
PR libstdc++/35637
|
||||||
|
* include/tr1_impl/type_traits (struct __in_array): Add back.
|
||||||
|
(is_function): Use it.
|
||||||
|
* testsuite/tr1/4_metaprogramming/is_function/35637.cc: New.
|
||||||
|
|
||||||
2008-03-20 Johannes Singler <singler@ira.uka.de>
|
2008-03-20 Johannes Singler <singler@ira.uka.de>
|
||||||
|
|
||||||
* include/parallel/set_operations.h: Removed superfluous
|
* include/parallel/set_operations.h (set_intersection): Remove.
|
||||||
set_intersection.
|
|
||||||
|
|
||||||
2008-03-19 Benjamin Kosnik <bkoz@redhat.com>
|
2008-03-19 Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// TR1 type_traits -*- C++ -*-
|
// TR1 type_traits -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2007 Free Software Foundation, Inc.
|
// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// 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
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -163,25 +163,29 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
|
||||||
: public integral_constant<bool, __is_class(_Tp)>
|
: public integral_constant<bool, __is_class(_Tp)>
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
template<typename>
|
template<typename _Tp>
|
||||||
struct __is_function_helper
|
struct __in_array
|
||||||
: public false_type { };
|
: public __sfinae_types
|
||||||
|
{
|
||||||
template<typename _Res, typename... _ArgTypes>
|
private:
|
||||||
struct __is_function_helper<_Res(_ArgTypes...)>
|
template<typename _Up>
|
||||||
: public true_type { };
|
static __one __test(_Up(*)[1]);
|
||||||
|
template<typename>
|
||||||
template<typename _Res, typename... _ArgTypes>
|
static __two __test(...);
|
||||||
struct __is_function_helper<_Res(_ArgTypes......)>
|
|
||||||
: public true_type { };
|
public:
|
||||||
|
static const bool __value = sizeof(__test<_Tp>(0)) == 1;
|
||||||
|
};
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_cv;
|
struct is_abstract;
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct is_function
|
struct is_function
|
||||||
: public integral_constant<bool, (__is_function_helper<typename
|
: public integral_constant<bool, !(__in_array<_Tp>::__value
|
||||||
remove_cv<_Tp>::type>::value)>
|
|| is_abstract<_Tp>::value
|
||||||
|
|| is_reference<_Tp>::value
|
||||||
|
|| is_void<_Tp>::value)>
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
/// @brief composite type traits [4.5.2].
|
/// @brief composite type traits [4.5.2].
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
// { dg-options "-pedantic-errors" }
|
||||||
|
// { dg-do compile }
|
||||||
|
|
||||||
|
// Copyright (C) 2008 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 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.
|
||||||
|
|
||||||
|
// 4.5.1 Primary type categories
|
||||||
|
|
||||||
|
#include <tr1/functional>
|
||||||
|
|
||||||
|
struct S
|
||||||
|
{
|
||||||
|
void F() const {}
|
||||||
|
};
|
||||||
|
|
||||||
|
// libstdc++/35637
|
||||||
|
void test01()
|
||||||
|
{
|
||||||
|
std::tr1::function<void (S *)> a(&S::F);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue