@@ -10733,12 +10758,35 @@ cp_parser_expression_statement (cp_parser* parser, tree in_statement_expr)
statement. */
if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
{
+ /* This might be attribute fallthrough. */
+ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_ATTRIBUTE))
{
+ tree attr = cp_parser_gnu_attributes_opt (parser);
+ if (maybe_attribute_fallthrough_p (attr))
+ statement = build_call_expr_internal_loc (token->location,
+ IFN_FALLTHROUGH,
+ void_type_node, 0);
+ else if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
+ {
+ cp_parser_error (parser, "only attribute %<fallthrough%> "
+ "can be applied to a null statement");
+ return error_mark_node;
+ }
+ else
+ {
+ cp_parser_error (parser, "expected primary-expression");
+ return error_mark_node;
+ }
+ }