diff options
author | Jason Merrill <jason@redhat.com> | 2009-03-31 14:31:17 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-03-31 14:31:17 -0400 |
commit | 0d9c089222329e55fb3d372e3c8029f5a18a080f (patch) | |
tree | 155b10aa3c254e87c8ef3b1be4137739cf355dfb /gcc/cp/tree.c | |
parent | a3c497526740202a565d78c77d29f2b93c92f1ee (diff) | |
download | gcc-0d9c089222329e55fb3d372e3c8029f5a18a080f.zip gcc-0d9c089222329e55fb3d372e3c8029f5a18a080f.tar.gz gcc-0d9c089222329e55fb3d372e3c8029f5a18a080f.tar.bz2 |
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
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 2287f11..b4b977e 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -852,11 +852,10 @@ cp_build_qualified_type_real (tree type, } /* A restrict-qualified type must be a pointer (or reference) - to object or incomplete type, or a function type. */ + to object or incomplete type. */ if ((type_quals & TYPE_QUAL_RESTRICT) && TREE_CODE (type) != TEMPLATE_TYPE_PARM && TREE_CODE (type) != TYPENAME_TYPE - && TREE_CODE (type) != FUNCTION_TYPE && !POINTER_TYPE_P (type)) { bad_quals |= TYPE_QUAL_RESTRICT; |