diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2008-08-09 15:58:52 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2008-08-09 15:58:52 +0000 |
commit | 6cccc200142d9a9d1dbafa0d0a1d8ec2cb0b2c14 (patch) | |
tree | 9786f974233296449789bfe817dbfed5aae84375 /libstdc++-v3 | |
parent | a031f958a6d74818ab537221200abe6ab3f5cf7c (diff) | |
download | gcc-6cccc200142d9a9d1dbafa0d0a1d8ec2cb0b2c14.zip gcc-6cccc200142d9a9d1dbafa0d0a1d8ec2cb0b2c14.tar.gz gcc-6cccc200142d9a9d1dbafa0d0a1d8ec2cb0b2c14.tar.bz2 |
Revert fix for libstdc++/35637, thanks to other/36901.
2008-08-09 Paolo Carlini <paolo.carlini@oracle.com>
Revert fix for libstdc++/35637, thanks to other/36901.
* include/tr1_impl/type_traits (__is_function_helper): New, uses
variadic templates.
(is_function): Forward to the latter.
(__in_array): Remove.
From-SVN: r138906
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/tr1_impl/type_traits | 33 |
2 files changed, 22 insertions, 19 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index af0bee0..c96ab5a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,13 @@ 2008-08-09 Paolo Carlini <paolo.carlini@oracle.com> + Revert fix for libstdc++/35637, thanks to other/36901. + * include/tr1_impl/type_traits (__is_function_helper): New, uses + variadic templates. + (is_function): Forward to the latter. + (__in_array): Remove. + +2008-08-09 Paolo Carlini <paolo.carlini@oracle.com> + * config/locale/darwin/ctype_members.cc: Include <cstdio>. 2008-08-08 Paolo Carlini <paolo.carlini@oracle.com> diff --git a/libstdc++-v3/include/tr1_impl/type_traits b/libstdc++-v3/include/tr1_impl/type_traits index 87633fa..3a3d66f 100644 --- a/libstdc++-v3/include/tr1_impl/type_traits +++ b/libstdc++-v3/include/tr1_impl/type_traits @@ -183,30 +183,25 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 { }; template<typename _Tp> - struct __in_array - : public __sfinae_types - { - private: - template<typename _Up> - static __one __test(_Up(*)[1]); - template<typename> - static __two __test(...); - - public: - static const bool __value = sizeof(__test<_Tp>(0)) == 1; - }; + struct remove_cv; - /// is_abstract - template<typename _Tp> - struct is_abstract; + template<typename> + struct __is_function_helper + : public false_type { }; + + template<typename _Res, typename... _ArgTypes> + struct __is_function_helper<_Res(_ArgTypes...)> + : public true_type { }; + + template<typename _Res, typename... _ArgTypes> + struct __is_function_helper<_Res(_ArgTypes......)> + : public true_type { }; /// is_function template<typename _Tp> struct is_function - : public integral_constant<bool, !(__in_array<_Tp>::__value - || is_abstract<_Tp>::value - || is_reference<_Tp>::value - || is_void<_Tp>::value)> + : public integral_constant<bool, (__is_function_helper<typename + remove_cv<_Tp>::type>::value)> { }; /// composite type traits [4.5.2]. |