MARK_TS_EXP (UNARY_RIGHT_FOLD_EXPR);
/* Constraints. */
- MARK_TS_EXP (CHECK_CONSTR);
MARK_TS_EXP (COMPOUND_REQ);
MARK_TS_EXP (CONJ_CONSTR);
MARK_TS_EXP (DISJ_CONSTR);
DEFTREECODE (CONJ_CONSTR, "conj_constr", tcc_expression, 2)
DEFTREECODE (DISJ_CONSTR, "disj_constr", tcc_expression, 2)
-/* A check constraint represents the checking of a concept
- C. It has two operands: the template defining the concept
- and a sequence of template arguments.
-
- CHECK_CONSTR_CONCEPT has the concept definition
- CHECK_CONSTR_ARGS are the template arguments. */
-DEFTREECODE (CHECK_CONSTR, "check_constr", tcc_expression, 2)
-
/* The co_await expression is used to support coroutines.
Op 0 is the cast expresssion (potentially modified by the
#define ATOMIC_CONSTR_EXPR(NODE) \
CONSTR_EXPR (ATOMIC_CONSTR_CHECK (NODE))
-/* The concept of a concept check. */
-#define CHECK_CONSTR_CONCEPT(NODE) \
- TREE_OPERAND (TREE_CHECK (NODE, CHECK_CONSTR), 0)
-
-/* The template arguments of a concept check. */
-#define CHECK_CONSTR_ARGS(NODE) \
- TREE_OPERAND (TREE_CHECK (NODE, CHECK_CONSTR), 1)
-
/* Whether a PARM_DECL represents a local parameter in a
requires-expression. */
#define CONSTRAINT_VAR_P(NODE) \
break;
case ATOMIC_CONSTR:
- case CHECK_CONSTR:
case CONJ_CONSTR:
case DISJ_CONSTR:
pp_cxx_constraint (this, t);
pp_cxx_semicolon (pp);
}
-void
-pp_cxx_check_constraint (cxx_pretty_printer *pp, tree t)
-{
- tree decl = CHECK_CONSTR_CONCEPT (t);
- tree tmpl = DECL_TI_TEMPLATE (decl);
- tree args = CHECK_CONSTR_ARGS (t);
- tree id = build_nt (TEMPLATE_ID_EXPR, tmpl, args);
-
- if (TREE_CODE (decl) == CONCEPT_DECL)
- pp->expression (id);
- else if (VAR_P (decl))
- pp->expression (id);
- else if (TREE_CODE (decl) == FUNCTION_DECL)
- {
- tree call = build_vl_exp (CALL_EXPR, 2);
- TREE_OPERAND (call, 0) = integer_two_node;
- TREE_OPERAND (call, 1) = id;
- pp->expression (call);
- }
- else
- gcc_unreachable ();
-}
-
/* Output the "[with ...]" clause for a parameter mapping of an atomic
constraint. */
pp_cxx_atomic_constraint (pp, t);
break;
- case CHECK_CONSTR:
- pp_cxx_check_constraint (pp, t);
- break;
-
case CONJ_CONSTR:
pp_cxx_conjunction (pp, t);
break;
break;
case ATOMIC_CONSTR:
- case CHECK_CONSTR:
case CONJ_CONSTR:
case DISJ_CONSTR:
{
return cp_tree_equal (CI_ASSOCIATED_CONSTRAINTS (t1),
CI_ASSOCIATED_CONSTRAINTS (t2));
- case CHECK_CONSTR:
- return (CHECK_CONSTR_CONCEPT (t1) == CHECK_CONSTR_CONCEPT (t2)
- && comp_template_args (CHECK_CONSTR_ARGS (t1),
- CHECK_CONSTR_ARGS (t2)));
-
case TREE_VEC:
/* These are template args. Really we should be getting the
caller to do this as it knows it to be true. */