Commit e0710fcf by Jason Merrill Committed by Jason Merrill

Handle [[likely]] on compound-statement.

I overlooked this case when adding [[likely]] handling to
cp_parser_statement.

	* parser.c (cp_parser_statement): Handle [[likely]] on
	compound-statement.

From-SVN: r275978
parent a519efbe
2019-09-17 Jason Merrill <jason@redhat.com>
* parser.c (cp_parser_statement): Handle [[likely]] on
compound-statement.
2019-09-19 Jason Merrill <jason@redhat.com> 2019-09-19 Jason Merrill <jason@redhat.com>
Revert: Revert:
......
...@@ -11297,7 +11297,10 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr, ...@@ -11297,7 +11297,10 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr,
} }
/* Anything that starts with a `{' must be a compound-statement. */ /* Anything that starts with a `{' must be a compound-statement. */
else if (token->type == CPP_OPEN_BRACE) else if (token->type == CPP_OPEN_BRACE)
statement = cp_parser_compound_statement (parser, NULL, BCS_NORMAL, false); {
std_attrs = process_stmt_hotness_attribute (std_attrs, attrs_loc);
statement = cp_parser_compound_statement (parser, NULL, BCS_NORMAL, false);
}
/* CPP_PRAGMA is a #pragma inside a function body, which constitutes /* CPP_PRAGMA is a #pragma inside a function body, which constitutes
a statement all its own. */ a statement all its own. */
else if (token->type == CPP_PRAGMA) else if (token->type == CPP_PRAGMA)
// { dg-do compile { target c++11 } }
void f(int i)
{
if (i) [[likely]]
{
++i;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment