From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8E2763829BED for ; Sun, 29 May 2022 19:55:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8E2763829BED Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-462-3FwtBm_NPEaVogtrnEvioQ-1; Sun, 29 May 2022 15:55:36 -0400 X-MC-Unique: 3FwtBm_NPEaVogtrnEvioQ-1 Received: by mail-qk1-f200.google.com with SMTP id c16-20020ae9e210000000b006a32c6a3830so7434435qkc.12 for ; Sun, 29 May 2022 12:55:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=MWllGpYqGusjqHpg6hWhllH1Td/j6l1lNhjl0uDs4gA=; b=4omKK3V01bCDN4qPjj8vzpATmPt1TXW/Gk4a1UiSyzf7dDlSv5I8bZT2vVnh+K0wPE DCPojRq5ERdqrJhZBSdRx50+fgi1hIjx5ZbOM9MkutrXmeILUlcJiMbv1xO+pn6IaeOv CnCB0VpvYJkNlP+ovWxU3LS7niVbgmU3IAtNBSxGH6Y0GgYFyoXdnCDGBVg4uyhncbiI fE+DWZIlALWe5rC1EFWraPByE1uMWFI0IHsPIyPXAExOisO9AgNrbfXfTQYjajnh7igB v4XBaPNpF7YKv7wtQyb3f5vrQtpnd7yu4N8VXCaDJlMQexvn2VU+0pfDDU23CSSf626W Y7ww== X-Gm-Message-State: AOAM5333MUju/0wOmC4mIVmvybaohWI4UlMOU9fcQVKh/aDt/qEeRDiB wNyuSKIIhD4s4shwyeEVFTl/tYbVj9XZJ2/GvmrvEMaJYOa/kgi/cCDbt3cOszV/zePqPiGnBEq yL72OnsO9xZz6cwnUfA== X-Received: by 2002:ae9:c313:0:b0:69d:7664:e51d with SMTP id n19-20020ae9c313000000b0069d7664e51dmr35374412qkg.199.1653854135683; Sun, 29 May 2022 12:55:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2s90cimBVz8Db/Xfi1Xqs6jyiIwK09co0wwxX0lYmhay1fPgHgL1aBAEaPn7RUDjBfNoOjA== X-Received: by 2002:ae9:c313:0:b0:69d:7664:e51d with SMTP id n19-20020ae9c313000000b0069d7664e51dmr35374407qkg.199.1653854135407; Sun, 29 May 2022 12:55:35 -0700 (PDT) Received: from [192.168.1.100] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id bm31-20020a05620a199f00b0069fc13ce1fesm7262721qkb.47.2022.05.29.12.55.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 May 2022 12:55:34 -0700 (PDT) Message-ID: <1343d72b-590b-dac0-803a-330e2b0bad2b@redhat.com> Date: Sun, 29 May 2022 15:55:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] c++: use current_template_constraints more To: Patrick Palka , gcc-patches@gcc.gnu.org References: <20220527180552.2908794-1-ppalka@redhat.com> From: Jason Merrill In-Reply-To: <20220527180552.2908794-1-ppalka@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2022 19:55:38 -0000 On 5/27/22 14:05, Patrick Palka wrote: > gcc/cp/ChangeLog: > > * decl.cc (grokvardecl): Use current_template_constraints. > (xref_tag): Likewise. > * semantics.cc (finish_template_template_parm): Likewise. OK. > --- > gcc/cp/decl.cc | 13 +++---------- > gcc/cp/semantics.cc | 3 +-- > 2 files changed, 4 insertions(+), 12 deletions(-) > > diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc > index 892e4a4b19b..26428ca7122 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); > } > > @@ -15852,13 +15850,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 cd7a2818feb..efdeb9318a7 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 ();