Skip to content

Commit

Permalink
Minor cleanups in parsing contract_assert
Browse files Browse the repository at this point in the history
  • Loading branch information
villevoutilainen committed May 30, 2024
1 parent 4c447ed commit 206a54d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gcc/cp/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12582,8 +12582,6 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr,
case RID_CONTASSERT:
if (flag_contracts_nonattr && flag_contracts)
{
tree mode = NULL_TREE; // not needed for non attribute contracts
tree result = NULL_TREE; // not needed for assertions
tree cont_assert = NULL_TREE;
cont_assert = token->u.value;

Expand All @@ -12592,7 +12590,6 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr,
tree contract;
matching_parens parens;
parens.require_open (parser);
/* Defer the parsing of pre/post contracts inside class definitions. */
/* Enable location wrappers when parsing contracts. */
auto suppression = make_temp_override (suppress_location_wrappers, 0);

Expand All @@ -12605,7 +12602,7 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr,
parens.require_close (parser);

/* Build the contract. */
contract = grok_contract (cont_assert, mode, result, condition, loc);
contract = grok_contract (cont_assert, NULL_TREE/*mode*/, NULL_TREE/*result*/, condition, loc);
std_attrs = finish_contract_attribute (cont_assert, contract);
}
else
Expand Down

0 comments on commit 206a54d

Please sign in to comment.