mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-02 00:43:44 +08:00
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:
parent
ee41918880
commit
41cbc04c44
@ -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.
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user