if (has_warning_spec (t))
u (get_warning_spec (t));
- /* Walk in forward order, as (for instance) REQUIRES_EXPR has a
- bunch of unscoped parms on its first operand. It's safer to
- create those in order. */
bool vl = TREE_CODE_CLASS (code) == tcc_vl_exp;
- for (unsigned limit = (vl ? VL_EXP_OPERAND_LENGTH (t)
- : TREE_OPERAND_LENGTH (t)),
- ix = unsigned (vl); ix != limit; ix++)
+ unsigned limit = (vl ? VL_EXP_OPERAND_LENGTH (t)
+ : TREE_OPERAND_LENGTH (t));
+ unsigned ix = unsigned (vl);
+ if (code == REQUIRES_EXPR)
+ {
+ /* The first operand of a REQUIRES_EXPR is a tree chain
+ of PARM_DECLs. We need to stream this separately as
+ otherwise we would only stream the first one. */
+ chained_decls (REQUIRES_EXPR_PARMS (t));
+ ++ix;
+ }
+ for (; ix != limit; ix++)
WT (TREE_OPERAND (t, ix));
}
else
put_warning_spec (t, u ());
bool vl = TREE_CODE_CLASS (code) == tcc_vl_exp;
- for (unsigned limit = (vl ? VL_EXP_OPERAND_LENGTH (t)
- : TREE_OPERAND_LENGTH (t)),
- ix = unsigned (vl); ix != limit; ix++)
+ unsigned limit = (vl ? VL_EXP_OPERAND_LENGTH (t)
+ : TREE_OPERAND_LENGTH (t));
+ unsigned ix = unsigned (vl);
+ if (code == REQUIRES_EXPR)
+ {
+ REQUIRES_EXPR_PARMS (t) = chained_decls ();
+ ++ix;
+ }
+ for (; ix != limit; ix++)
RTU (TREE_OPERAND (t, ix));
}
break;
case PARM_DECL:
- /* REQUIRES_EXPRs have a tree list of uncontexted
- PARM_DECLS. It'd be nice if they had a
- distinguishing flag to double check. */
+ /* REQUIRES_EXPRs have a chain of uncontexted PARM_DECLS,
+ and an implicit this parm in an NSDMI has no context. */
+ gcc_checking_assert (CONSTRAINT_VAR_P (t)
+ || DECL_NAME (t) == this_identifier);
break;
case TYPE_DECL: