From 0d9c089222329e55fb3d372e3c8029f5a18a080f Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 31 Mar 2009 14:31:17 -0400 Subject: re PR c++/37806 (CV-qualifiers on function typedef's are inconsistently accepted depending on typedef scope) PR c++/37806 * 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. From-SVN: r145365 --- gcc/cp/typeck.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/cp/typeck.c') diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 3788a7e..fe791f3 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -7239,6 +7239,9 @@ cp_apply_type_quals_to_decl (int type_quals, tree decl) if (type == error_mark_node) return; + if (TREE_CODE (decl) == TYPE_DECL) + return; + if (TREE_CODE (type) == FUNCTION_TYPE && type_quals != TYPE_UNQUALIFIED) { -- cgit v1.1