Commit 5600f233 by Joseph Myers Committed by Joseph Myers

re PR c/35447 (ICE with broken statement expression)

	PR c/35447
	* c-parser.c (c_parser_compound_statement): Always enter and leave
	a scope.

testsuite:
	* gcc.dg/noncompile/pr35447-1.c: New test.

From-SVN: r144256
parent afd1efee
2009-02-18 Joseph Myers <joseph@codesourcery.com>
PR c/35447
* c-parser.c (c_parser_compound_statement): Always enter and leave
a scope.
2009-02-17 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/34587
......
......@@ -3307,7 +3307,13 @@ c_parser_compound_statement (c_parser *parser)
{
tree stmt;
if (!c_parser_require (parser, CPP_OPEN_BRACE, "expected %<{%>"))
return error_mark_node;
{
/* Ensure a scope is entered and left anyway to avoid confusion
if we have just prepared to enter a function body. */
stmt = c_begin_compound_stmt (true);
c_end_compound_stmt (stmt, true);
return error_mark_node;
}
stmt = c_begin_compound_stmt (true);
c_parser_compound_statement_nostart (parser);
return c_end_compound_stmt (stmt, true);
......
2009-02-18 Joseph Myers <joseph@codesourcery.com>
PR c/35447
* gcc.dg/noncompile/pr35447-1.c: New test.
2009-02-18 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/36922
......
/* ICE arising from preparing to enter a scope for a nested function
but never doing so. PR 35447. */
void foo()
{
({ int i().; }); /* { dg-error "expected" } */
} /* { dg-error "expected" } */
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