From: Nathan Sidwell Date: Thu, 24 Feb 2000 09:48:18 +0000 (+0000) Subject: decl.c (grokdeclarator): Diagnose qualifiers on non-member function type, rather... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=41cbc04c44b5904d70d165d95d26e53896a5c82a;p=gcc.git decl.c (grokdeclarator): Diagnose qualifiers on non-member function type, rather than ICE. * decl.c (grokdeclarator): Diagnose qualifiers on non-member function type, rather than ICE. From-SVN: r32132 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6a161ed02e7..36b8144dc13 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-02-24 Nathan Sidwell + + * decl.c (grokdeclarator): Diagnose qualifiers on non-member + function type, rather than ICE. + 2000-02-23 Jason Merrill * decl.c (grokdeclarator): Call decl_type_access_control. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 6b3df7ff3a5..cafe3938b16 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10788,14 +10788,19 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) } else if (quals) { - tree dummy = build_decl (TYPE_DECL, declarator, type); if (ctype == NULL_TREE) { - my_friendly_assert (TREE_CODE (type) == METHOD_TYPE, 159); - ctype = TYPE_METHOD_BASETYPE (type); + if (TREE_CODE (type) != METHOD_TYPE) + cp_error ("invalid qualifiers on non-member function type"); + else + ctype = TYPE_METHOD_BASETYPE (type); + } + if (ctype) + { + tree dummy = build_decl (TYPE_DECL, declarator, type); + grok_method_quals (ctype, dummy, quals); + type = TREE_TYPE (dummy); } - grok_method_quals (ctype, dummy, quals); - type = TREE_TYPE (dummy); } return type;