diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-07 04:38:10 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-07 04:38:10 +0000 |
commit | 874ab219a7aa5c8f824992f4b27bc0c5e1f9d412 (patch) | |
tree | 5ce4bc623dba8b471bd245e56bfc5054b913269b /libstdc++-v3 | |
parent | f42c3cf5c85f1358567c991eb489e0e40dd54266 (diff) |
* decl.c (grokdeclarator): Reject pointer to qualified function
type.
PR c++/37806, core issue 547
* typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
to a typedef.
* tree.c (cp_build_qualified_type_real): Don't apply restrict to a
function type.
* decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
* decl.c (groktypename): Add is_template_arg parameter.
(grokdeclarator): Allow function cv-quals on a template type arg.
* parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
is_template_arg argument in calls to groktypename.
* cp-tree.h: Adjust prototype.
* error.c (dump_type_prefix, dump_type_suffix): Fix plain
FUNCTION_TYPE printing.
PR libstdc++/39310
* include/tr1_impl/type_traits (is_function): Add partial
specializations with function cv-quals.
(__is_function_helper): Remove.
(is_member_pointer): Don't define in terms of is_member_*_pointer.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_4-branch@145648 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/tr1_impl/type_traits | 46 |
2 files changed, 38 insertions, 16 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 57db4ad2392..35ae72bb26c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2009-04-07 Jason Merrill <jason@redhat.com> + + PR libstdc++/39310 + * include/tr1_impl/type_traits (is_function): Add partial + specializations with function cv-quals. + (__is_function_helper): Remove. + (is_member_pointer): Don't define in terms of is_member_*_pointer. + 2009-04-02 Jakub Jelinek <jakub@redhat.com> * config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt: diff --git a/libstdc++-v3/include/tr1_impl/type_traits b/libstdc++-v3/include/tr1_impl/type_traits index cb0ad44a5ff..0672c398693 100644 --- a/libstdc++-v3/include/tr1_impl/type_traits +++ b/libstdc++-v3/include/tr1_impl/type_traits @@ -224,24 +224,34 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 : public integral_constant<bool, __is_class(_Tp)> { }; + /// is_function template<typename> - struct __is_function_helper + struct is_function : public false_type { }; - template<typename _Res, typename... _ArgTypes> - struct __is_function_helper<_Res(_ArgTypes...)> + struct is_function<_Res(_ArgTypes...)> : public true_type { }; - template<typename _Res, typename... _ArgTypes> - struct __is_function_helper<_Res(_ArgTypes......)> + struct is_function<_Res(_ArgTypes......)> + : public true_type { }; + template<typename _Res, typename... _ArgTypes> + struct is_function<_Res(_ArgTypes...) const> + : public true_type { }; + template<typename _Res, typename... _ArgTypes> + struct is_function<_Res(_ArgTypes......) const> + : public true_type { }; + template<typename _Res, typename... _ArgTypes> + struct is_function<_Res(_ArgTypes...) volatile> + : public true_type { }; + template<typename _Res, typename... _ArgTypes> + struct is_function<_Res(_ArgTypes......) volatile> + : public true_type { }; + template<typename _Res, typename... _ArgTypes> + struct is_function<_Res(_ArgTypes...) const volatile> + : public true_type { }; + template<typename _Res, typename... _ArgTypes> + struct is_function<_Res(_ArgTypes......) const volatile> : public true_type { }; - - /// is_function - template<typename _Tp> - struct is_function - : public integral_constant<bool, (__is_function_helper<typename - remove_cv<_Tp>::type>::value)> - { }; // composite type traits [4.5.2]. @@ -287,10 +297,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 /// is_member_pointer template<typename _Tp> - struct is_member_pointer - : public integral_constant<bool, - (is_member_object_pointer<_Tp>::value - || is_member_function_pointer<_Tp>::value)> + struct __is_member_pointer_helper + : public false_type { }; + _DEFINE_SPEC(2, __is_member_pointer_helper, _Tp _Cp::*, true) + + template<typename _Tp> + struct is_member_pointer + : public integral_constant<bool, (__is_member_pointer_helper< + typename remove_cv<_Tp>::type>::value)> { }; // type properties [4.5.3]. |