From: Nathan Sidwell Date: Mon, 4 May 2020 16:44:39 +0000 (-0700) Subject: c++: Don't save parms in nested requirement [pr 94827] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f1621d18f5517977c161f0fb29c54b4ef7d8245c;p=gcc.git c++: Don't save parms in nested requirement [pr 94827] This followup patch just removes some stashing that we never made use of. * constraint.cc (tsubst_nested_requirement): TYPE directly holds notmalized requirement. (finish_nested_requirement): Don't stash current tpl parms into the requirement. (diagnose_nested_requirement): TYPE directly holds notmalized requirement. --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5f2db010cb2..3d5f273477f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2020-05-04 Nathan Sidwell + + PR c++/94827 -- don't save parms in nested requirement + * constraint.cc (tsubst_nested_requirement): TYPE directly holds + notmalized requirement. + (finish_nested_requirement): Don't stash current tpl parms into + the requirement. + (diagnose_nested_requirement): TYPE directly holds notmalized + requirement. + 2020-05-01 Patrick Palka PR c++/90880 diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index 85513fecf43..4ad17f3b7d8 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -2010,7 +2010,7 @@ static tree tsubst_nested_requirement (tree t, tree args, subst_info info) { /* Ensure that we're in an evaluation context prior to satisfaction. */ - tree norm = TREE_VALUE (TREE_TYPE (t)); + tree norm = TREE_TYPE (t); tree result = satisfy_constraint (norm, args, info); if (result == error_mark_node && info.quiet ()) { @@ -2958,16 +2958,9 @@ finish_nested_requirement (location_t loc, tree expr) /* Currently open template headers have dummy arg vectors, so don't pass into normalization. */ tree norm = normalize_constraint_expression (expr, NULL_TREE, false); - tree args = current_template_parms - ? template_parms_to_args (current_template_parms) : NULL_TREE; - - /* Save the normalized constraint and complete set of normalization - arguments with the requirement. We keep the complete set of arguments - around for re-normalization during diagnostics. */ - tree info = build_tree_list (args, norm); /* Build the constraint, saving its normalization as its type. */ - tree r = build1 (NESTED_REQ, info, expr); + tree r = build1 (NESTED_REQ, norm, expr); SET_EXPR_LOCATION (r, loc); return r; } @@ -3370,7 +3363,7 @@ diagnose_nested_requirement (tree req, tree args) { /* Quietly check for satisfaction first. We can elaborate details later if needed. */ - tree norm = TREE_VALUE (TREE_TYPE (req)); + tree norm = TREE_TYPE (req); subst_info info (tf_none, NULL_TREE); tree result = satisfy_constraint (norm, args, info); if (result == boolean_true_node)