Commit a47e20fd by Joseph Myers Committed by Joseph Myers

re PR c/35446 (ICE with invalid array initializer)

	PR c/35446
	* c-parser.c (c_parser_braced_init): Call pop_init_level when
	skipping until next close brace.

testsuite:
	* gcc.dg/noncompile/init-5.c: New test.
	* gcc.dg/init-bad-4.c: Adjust expected errors.

From-SVN: r144216
parent 50aab7dc
2009-02-16 Joseph Myers <joseph@codesourcery.com>
PR c/35446
* c-parser.c (c_parser_braced_init): Call pop_init_level when
skipping until next close brace.
2009-02-16 H.J. Lu <hongjiu.lu@intel.com>
PR target/37049
......
......@@ -3036,6 +3036,7 @@ c_parser_braced_init (c_parser *parser, tree type, bool nested_p)
ret.value = error_mark_node;
ret.original_code = ERROR_MARK;
c_parser_skip_until_found (parser, CPP_CLOSE_BRACE, "expected %<}%>");
pop_init_level (0);
return ret;
}
c_parser_consume_token (parser);
......
2009-02-16 Joseph Myers <joseph@codesourcery.com>
PR c/35446
* gcc.dg/noncompile/init-5.c: New test.
* gcc.dg/init-bad-4.c: Adjust expected errors.
2009-02-16 H.J. Lu <hongjiu.lu@intel.com>
PR target/37049
......
......@@ -2,4 +2,4 @@
/* Origin: Richard Guenther <rguenth@gcc.gnu.org> */
/* { dg-do compile } */
struct A { } a = (struct A) {{ (X)0 }}; /* { dg-error "no members|extra brace|near|undeclared|constant|compound" } */
struct A { } a = (struct A) {{ (X)0 }}; /* { dg-error "no members|extra brace|near|undeclared|constant|compound|excess" } */
/* Test for ICE after syntax error in initializer with range
designator: PR 35446. */
int a[2][2] = { [0 ... 1] = { ; } }; /* { dg-error "expected expression" } */
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