/* Eat the '('. */
matching_parens parens;
parens.consume_open (parser);
+ bool syntax_error = false;
while (true)
{
- bool syntax_error = false;
cp_token *token = cp_lexer_peek_token (parser->lexer);
enum rid keyword;
if (token->type != CPP_NAME)
{
cp_parser_error (parser, "expected identifier");
+ syntax_error = true;
break;
}
keyword = C_RID_CODE (token->u.value);
break;
}
- /* FIXME: "@property (setter, assign);" will generate a spurious
- "error: expected ‘)’ before ‘,’ token". This is because
- cp_parser_require, unlike the C counterpart, will produce an
- error even if we are in error recovery. */
- if (!parens.require_close (parser))
- {
- cp_parser_skip_to_closing_parenthesis (parser,
+ if (syntax_error || !parens.require_close (parser))
+ cp_parser_skip_to_closing_parenthesis (parser,
/*recovering=*/true,
/*or_comma=*/false,
/*consume_paren=*/true);
- }
}
/* ... and the property declaration(s). */
@property (xxx) int g; /* { dg-error "unknown property attribute" } */
@property (readonly,xxx) int h; /* { dg-error "unknown property attribute" } */
@property ( int i; /* { dg-error "expected identifier" } */
- /* { dg-error "expected ... " "" { target *-*-* } .-1 } */
@end