diff options
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 9aef031..6dfcb60 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -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); |