Commit dd29188b by Nathan Sidwell Committed by Nathan Sidwell

decl.c (grokdeclarator): Use assert, not internal_error.

cp:
	* decl.c (grokdeclarator): Use assert, not internal_error. Don't
	ICE with invalid pointers & references.
testsuite:
	* g++.old-deja/g++.other/crash32.C: Mark ICE.

From-SVN: r57277
parent 5e7a8ee0
2002-09-18 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (grokdeclarator): Use assert, not internal_error. Don't
ICE with invalid pointers & references.
2002-09-17 Zack Weinberg <zack@codesourcery.com> 2002-09-17 Zack Weinberg <zack@codesourcery.com>
* Make-lang.in: Remove all references to the demangler. * Make-lang.in: Remove all references to the demangler.
......
...@@ -10024,7 +10024,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10024,7 +10024,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
break; break;
default: default:
internal_error ("`%D' as declarator", decl); my_friendly_assert (0, 20020917);
} }
} }
} }
...@@ -10903,21 +10903,15 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10903,21 +10903,15 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TREE_CODE (type) == REFERENCE_TYPE) if (TREE_CODE (type) == REFERENCE_TYPE)
{ {
error ("cannot declare %s to references", error (TREE_CODE (declarator) == ADDR_EXPR
TREE_CODE (declarator) == ADDR_EXPR ? "cannot declare reference to `%#T'"
? "references" : "pointers"); : "cannot declare pointer to `%#T'", type);
declarator = TREE_OPERAND (declarator, 0);
continue;
}
if (ctype
&& (TREE_CODE (type) == VOID_TYPE
|| TREE_CODE (type) == REFERENCE_TYPE))
{
error ("cannot declare pointer to `%#T' member",
TREE_TYPE (type));
type = TREE_TYPE (type); type = TREE_TYPE (type);
} }
else if (VOID_TYPE_P (type)
&& (ctype || TREE_CODE (declarator) == ADDR_EXPR))
error (ctype ? "cannot declare pointer to `%#T' member"
: "cannot declare reference to `%#T'", type);
/* Merge any constancy or volatility into the target type /* Merge any constancy or volatility into the target type
for the pointer. */ for the pointer. */
...@@ -10928,9 +10922,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10928,9 +10922,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (TREE_CODE (declarator) == ADDR_EXPR) if (TREE_CODE (declarator) == ADDR_EXPR)
{ {
if (TREE_CODE (type) == VOID_TYPE) if (!VOID_TYPE_P (type))
error ("invalid type: `void &'");
else
type = build_reference_type (type); type = build_reference_type (type);
} }
else if (TREE_CODE (type) == METHOD_TYPE) else if (TREE_CODE (type) == METHOD_TYPE)
......
2002-09-18 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.other/crash32.C: Mark ICE.
Tue Sep 17 13:59:45 2002 Nicola Pero <n.pero@mi.flashnet.it> Tue Sep 17 13:59:45 2002 Nicola Pero <n.pero@mi.flashnet.it>
* objc.dg/comp-types-1.m: New test. * objc.dg/comp-types-1.m: New test.
......
...@@ -26,7 +26,7 @@ namespace N ...@@ -26,7 +26,7 @@ namespace N
typedef baz<bar> c; typedef baz<bar> c;
} }
struct z struct z // crash test - XFAIL *-*-*
{ {
int a; int a;
}; };
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