#define processing_explicit_instantiation scope_chain->x_processing_explicit_instantiation
#define processing_omp_trait_property_expr scope_chain->x_processing_omp_trait_property_expr
+/* Nonzero if we are parsing the expression of a contract condition. These
+ expressions appear outside the parameter list (like a trailing return
+ type), but are potentially evaluated. */
+
+#define processing_contract_condition \
+ (scope_chain->bindings->kind == sk_contract)
+
#define in_discarded_stmt scope_chain->discarded_stmt
#define in_consteval_if_p scope_chain->consteval_if_p
#define in_expansion_stmt scope_chain->expansion_stmt
"template-explicit-spec-scope",
"transaction-scope",
"openmp-scope",
- "lambda-scope"
+ "lambda-scope",
+ "contract-check-scope"
};
static_assert (ARRAY_SIZE (scope_kind_names) == sk_count,
"must keep names aligned with scope_kind enum");
case sk_scoped_enum:
case sk_transaction:
case sk_omp:
+ case sk_contract:
case sk_stmt_expr:
case sk_lambda:
scope->keep = keep_next_level_flag;
sk_transaction, /* A synchronized or atomic statement. */
sk_omp, /* An OpenMP structured block. */
sk_lambda, /* A lambda scope. */
+ sk_contract, /* A C++26 contract-assertion scope.
+ [basic.scope.contract] */
sk_count /* Number of scope_kind enumerations. */
};