c-typeck.c (output_init_element): Check for type == error_mark_node.

gcc:
	* c-typeck.c (output_init_element): Check for type == error_mark_node.
gcc/testsuite:
	* gcc.dg/noncompile/init-4.c.c: New test.

From-SVN: r65328
This commit is contained in:
J"orn Rennecke 2003-04-07 11:55:27 +00:00 committed by Joern Rennecke
parent 093b05b68f
commit d5019ba399
4 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2003-04-07 J"orn Rennecke <joern.rennecke@superh.com>
* c-typeck.c (output_init_element): Check for type == error_mark_node.
2003-04-07 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.md (*zero_extendqisi2_h8300hs): Always

View File

@ -6227,6 +6227,11 @@ output_init_element (value, type, field, pending)
tree value, type, field;
int pending;
{
if (type == error_mark_node)
{
constructor_erroneous = 1;
return;
}
if (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE
|| (TREE_CODE (TREE_TYPE (value)) == ARRAY_TYPE
&& !(TREE_CODE (value) == STRING_CST

View File

@ -1,3 +1,7 @@
2003-04-07 J"orn Rennecke <joern.rennecke@superh.com>
* gcc.dg/noncompile/init-4.c.c: New test.
2003-04-06 Nathan Sidwell <nathan@codesourcery.com>
* gcc.misc-test/gcov-9.c: New test.

View File

@ -0,0 +1,3 @@
struct a { char *b; } c[D] /* { dg-error "undeclared" } */
= /* { dg-error "storage size" } */
{ { "" } } ; /* { dg-warning "braces around scalar initializer|near" } */