aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2000-02-24 09:48:18 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2000-02-24 09:48:18 +0000
commit41cbc04c44b5904d70d165d95d26e53896a5c82a (patch)
tree250609ef792fde5f8a4dc2533e5093f47b96623e
parentee4191888029e288e1a3c4cb2371d16a6a95d7b5 (diff)
downloadgcc-41cbc04c44b5904d70d165d95d26e53896a5c82a.zip
gcc-41cbc04c44b5904d70d165d95d26e53896a5c82a.tar.gz
gcc-41cbc04c44b5904d70d165d95d26e53896a5c82a.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c15
2 files changed, 15 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6a161ed..36b8144 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 6b3df7f..cafe393 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;