This fixes both callers in tsubst_requires_expr to tsubst_constraint_variables to wrap their respective trees in PARM_CONSTR_PARMS. This is to get the correct parmeter constraints from the tree before calling tsubst_constraint_variables like other callers in constraint.cc and to avoid subtle bugs in the future.
Signed-off-by: Nicholas Krause <xerofo...@gmail.com> --- gcc/cp/constraint.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index 9884eb0db50..cb06d0ec6e2 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -1882,13 +1882,13 @@ tsubst_requires_expr (tree t, tree args, tree parms = TREE_OPERAND (t, 0); if (parms) { - parms = tsubst_constraint_variables (parms, args, complain, in_decl); + parms = tsubst_constraint_variables (PARM_CONSTR_PARMS (parms), args, complain, in_decl); if (parms == error_mark_node) return error_mark_node; } tree reqs = TREE_OPERAND (t, 1); - reqs = tsubst_requirement_body (reqs, args, complain, in_decl); + reqs = tsubst_requirement_body (PARM_CONSTR_PARMS (reqs), args, complain, in_decl); if (reqs == error_mark_node) return error_mark_node; -- 2.17.1