From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1888) id 312233858D33; Tue, 31 May 2022 12:21:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 312233858D33 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Patrick Palka To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-863] c++: use current_template_constraints more X-Act-Checkin: gcc X-Git-Author: Patrick Palka X-Git-Refname: refs/heads/master X-Git-Oldrev: f38b20d68fade5a922b9f68c4c3841e653d1b83c X-Git-Newrev: b5cf960e29fe59772b8bf5fca068e7139651255b Message-Id: <20220531122155.312233858D33@sourceware.org> Date: Tue, 31 May 2022 12:21:55 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2022 12:21:55 -0000 https://gcc.gnu.org/g:b5cf960e29fe59772b8bf5fca068e7139651255b commit r13-863-gb5cf960e29fe59772b8bf5fca068e7139651255b Author: Patrick Palka Date: Tue May 31 08:17:21 2022 -0400 c++: use current_template_constraints more gcc/cp/ChangeLog: * decl.cc (grokvardecl): Use current_template_constraints. (grokdeclarator): Likewise. (xref_tag): Likewise. * semantics.cc (finish_template_template_parm): Likewise. Diff: --- gcc/cp/decl.cc | 17 ++++------------- gcc/cp/semantics.cc | 3 +-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 892e4a4b19b..663a72fae15 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -10789,9 +10789,7 @@ grokvardecl (tree type, else if (flag_concepts && current_template_depth > template_class_depth (scope)) { - tree reqs = TEMPLATE_PARMS_CONSTRAINTS (current_template_parms); - tree ci = build_constraints (reqs, NULL_TREE); - + tree ci = current_template_constraints (); set_constraints (decl, ci); } @@ -14227,9 +14225,7 @@ grokdeclarator (const cp_declarator *declarator, > template_class_depth (current_class_type)); if (memtmpl) { - tree tmpl_reqs - = TEMPLATE_PARMS_CONSTRAINTS (current_template_parms); - tree ci = build_constraints (tmpl_reqs, NULL_TREE); + tree ci = current_template_constraints (); set_constraints (decl, ci); } } @@ -15852,13 +15848,8 @@ xref_tag (enum tag_types tag_code, tree name, { /* Check that we aren't trying to overload a class with different constraints. */ - tree constr = NULL_TREE; - if (current_template_parms) - { - tree reqs = TEMPLATE_PARMS_CONSTRAINTS (current_template_parms); - constr = build_constraints (reqs, NULL_TREE); - } - if (!redeclare_class_template (t, current_template_parms, constr)) + if (!redeclare_class_template (t, current_template_parms, + current_template_constraints ())) return error_mark_node; } else if (!processing_template_decl diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc index 1d012d60724..3600d270ff8 100644 --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -3387,8 +3387,7 @@ finish_template_template_parm (tree aggr, tree identifier) /* Associate the constraints with the underlying declaration, not the template. */ - tree reqs = TEMPLATE_PARMS_CONSTRAINTS (current_template_parms); - tree constr = build_constraints (reqs, NULL_TREE); + tree constr = current_template_constraints (); set_constraints (decl, constr); end_template_decl ();