From: Matthias Braun Date: Sat, 7 Mar 2009 20:40:28 +0000 (+0000) Subject: fix __extension__ in for statement X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=76ebc662b0acb3571f519f150fce9eeba3f619f6;p=cparser fix __extension__ in for statement [r25615] --- diff --git a/parser.c b/parser.c index a7f4d80..94da9e4 100644 --- a/parser.c +++ b/parser.c @@ -9790,6 +9790,12 @@ static statement_t *parse_for(void) size_t const top = environment_top(); scope_t *old_scope = scope_push(&statement->fors.scope); + bool old_gcc_extension; + while (token.type == T___extension__) { + next_token(); + in_gcc_extension = true; + } + if (token.type == ';') { next_token(); } else if (is_declaration_specifier(&token, false)) { @@ -9806,6 +9812,7 @@ static statement_t *parse_for(void) rem_anchor_token(';'); expect(';', end_error2); } + in_gcc_extension = old_gcc_extension; if (token.type != ';') { add_anchor_token(';');