aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r--gcc/c/c-parser.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 4772086..6b41a61 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -7930,7 +7930,10 @@ c_parser_postfix_expression (c_parser *parser)
c_parser_consume_token (parser);
brace_loc = c_parser_peek_token (parser)->location;
c_parser_consume_token (parser);
- if (!building_stmt_list_p ())
+ /* If we've not yet started the current function's statement list,
+ or we're in the parameter scope of an old-style function
+ declaration, statement expressions are not allowed. */
+ if (!building_stmt_list_p () || old_style_parameter_scope ())
{
error_at (loc, "braced-group within expression allowed "
"only inside a function");