This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
/* If the tentative parse failed, then we shall need to look for an expression-statement. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_COLON)) + { + /* It is a range-for, consume the ':' */ + cp_lexer_consume_token (parser->lexer); + if (cxx_dialect < cxx0x) + { + error_at (cp_lexer_peek_token (parser->lexer)->location, + "range-based-for loops are not allowed " + "in C++98 mode"); + } + else if (*decl && *decl != error_mark_node ) + is_range_for = true; + /* Else an error has been found in the declaration. It should have + been reported by now, so no message is required. */ + }
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |