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.129.124]) by sourceware.org (Postfix) with ESMTPS id B7D393829BF7 for ; Fri, 27 May 2022 18:05:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B7D393829BF7 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-477-afAOc9ppONGQh5Z47hAHDg-1; Fri, 27 May 2022 14:05:55 -0400 X-MC-Unique: afAOc9ppONGQh5Z47hAHDg-1 Received: by mail-qv1-f71.google.com with SMTP id j2-20020a0cfd42000000b0045ad9cba5deso4104261qvs.5 for ; Fri, 27 May 2022 11:05:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3er8mydIa4wE2B1gHSMoxn9Izwsg2yTQMKhMd6i04yQ=; b=onKlQqw6VHKp4vnO+tju7oYLZq5gxyzzlq+pDR2cp9iXygB8vuuzjOAWAFyVT8HgU/ m8Kqcq1ppXE1AsSjxbdQVqcc0i9m/oJAbWsG8dLCHZ9cWSi7+yq01sy3ayq/s8lRh9hQ cMZ6ZLIwJvovTu7MSJEbozHb6jE8j4m0sWRn3QkOoKj9hcgqcvBtooBdn54VydDsrMwc i+IpGU6z/R36nOExrxd+aB1jsE4VxyjLYk0wgn5P+xlWzvP2XBJ9apEPNjtpAN7iIqxk C109B1D6QRe0WoRqK94QfCCz695/vX9eMgtFrUnchwKT4f6EVQ/J5SNaGxXDf8T/FOMg 8ljA== X-Gm-Message-State: AOAM532Okue1WcZPzm0x4FaOaMQ3YmIPR/jck5oNEVmdcL3jYv4QkQDf iwR0qbIDUGsJiqK1ZjvOesgkJCEfZr/r02HRTt6JlmBsPbZovGDXf8R/pD3ZqQ/AkbxYrH1NRnO ZBd+pYoD1I/fdYtIxyFboUjQpB1IoM5kLIQnGdIhcsQEeuW3ZaDfhnw95rdHqDjs+qww= X-Received: by 2002:a37:2708:0:b0:6a3:ad4e:f2d7 with SMTP id n8-20020a372708000000b006a3ad4ef2d7mr16411674qkn.571.1653674754479; Fri, 27 May 2022 11:05:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQm218sw30DpzvYgi1T43Emp0UVWLpJWlX17O0kQSzR/4/1qM1pk7rjSVuyZDEhE7UeKANXQ== X-Received: by 2002:a37:2708:0:b0:6a3:ad4e:f2d7 with SMTP id n8-20020a372708000000b006a3ad4ef2d7mr16411642qkn.571.1653674754147; Fri, 27 May 2022 11:05:54 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id d13-20020ac84e2d000000b002f39b99f6a3sm2712347qtw.61.2022.05.27.11.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 11:05:53 -0700 (PDT) From: Patrick Palka To: gcc-patches@gcc.gnu.org Subject: [PATCH] c++: use current_template_constraints more Date: Fri, 27 May 2022 14:05:52 -0400 Message-Id: <20220527180552.2908794-1-ppalka@redhat.com> X-Mailer: git-send-email 2.36.1.195.g8ddf593a25 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: Fri, 27 May 2022 18:05:57 -0000 gcc/cp/ChangeLog: * decl.cc (grokvardecl): Use current_template_constraints. (xref_tag): Likewise. * semantics.cc (finish_template_template_parm): Likewise. --- 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 (); -- 2.36.1.195.g8ddf593a25