Skip to content

Commit 843e50f

Browse files
Merge pull request #49 from iains/contracts-nonattr-nfc-cleanups
Contracts nonattr NFC cleanups
2 parents a77cb5e + 3e3d032 commit 843e50f

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

gcc/c-family/c.opt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ Enable the non-attribute syntax for contracts.
18521852

18531853
fcontracts-nonattr-noconst
18541854
C++ Var(flag_contracts_nonattr_noconst) Init(0)
1855-
Disable the consitification of entities appearing in a contract condition.
1855+
Disable the const-ification of entities appearing in a contract condition.
18561856

18571857
fcontracts-nonattr-mutable-keyword
18581858
C++ Var(flag_contracts_nonattr_mutable_keyword) Init(0)

gcc/cp/parser.cc

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12295,11 +12295,8 @@ cp_parser_lambda_body (cp_parser* parser, tree lambda_expr)
1229512295

1229612296
/* We need to parse deferred contract conditions before we try to call
1229712297
finish_function (which will try to emit the contracts). */
12298-
for (tree a = DECL_ATTRIBUTES (fco); a; a = TREE_CHAIN (a))
12299-
{
12300-
if (cxx_contract_attribute_p (a))
12301-
cp_parser_late_contract_condition (parser, fco, a);
12302-
}
12298+
for (tree a = DECL_CONTRACTS (fco); a; a = CONTRACT_CHAIN (a))
12299+
cp_parser_late_contract_condition (parser, fco, a);
1230312300

1230412301
finish_lambda_function (body);
1230512302
}
@@ -27606,11 +27603,8 @@ cp_parser_class_specifier (cp_parser* parser)
2760627603
parser->local_variables_forbidden_p |= THIS_FORBIDDEN;
2760727604

2760827605
/* Now we can parse contract conditions. */
27609-
for (tree a = DECL_ATTRIBUTES (decl); a; a = TREE_CHAIN (a))
27610-
{
27611-
if (cxx_contract_attribute_p (a))
27612-
cp_parser_late_contract_condition (parser, decl, a);
27613-
}
27606+
for (tree a = DECL_CONTRACTS (decl); a; a = CONTRACT_CHAIN (a))
27607+
cp_parser_late_contract_condition (parser, decl, a);
2761427608

2761527609
/* Restore the state of local_variables_forbidden_p. */
2761627610
parser->local_variables_forbidden_p = local_variables_forbidden_p;

0 commit comments

Comments
 (0)