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
This commit is contained in:
Nathan Sidwell 2000-02-24 09:48:18 +00:00 committed by Nathan Sidwell
parent ee41918880
commit 41cbc04c44
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2000-02-24 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (grokdeclarator): Diagnose qualifiers on non-member
function type, rather than ICE.
2000-02-23 Jason Merrill <jason@casey.cygnus.com>
* decl.c (grokdeclarator): Call decl_type_access_control.

View File

@ -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;