Commit 41cbc04c by Nathan Sidwell Committed by Nathan Sidwell

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
parent ee419188
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> 2000-02-23 Jason Merrill <jason@casey.cygnus.com>
* decl.c (grokdeclarator): Call decl_type_access_control. * decl.c (grokdeclarator): Call decl_type_access_control.
......
...@@ -10788,14 +10788,19 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10788,14 +10788,19 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
} }
else if (quals) else if (quals)
{ {
tree dummy = build_decl (TYPE_DECL, declarator, type);
if (ctype == NULL_TREE) if (ctype == NULL_TREE)
{ {
my_friendly_assert (TREE_CODE (type) == METHOD_TYPE, 159); if (TREE_CODE (type) != METHOD_TYPE)
ctype = TYPE_METHOD_BASETYPE (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; return type;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment