fix __extension__ in for statement
authorMatthias Braun <matze@braunis.de>
Sat, 7 Mar 2009 20:40:28 +0000 (20:40 +0000)
committerMatthias Braun <matze@braunis.de>
Sat, 7 Mar 2009 20:40:28 +0000 (20:40 +0000)
[r25615]

parser.c

index a7f4d80..94da9e4 100644 (file)
--- 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(';');