From patchwork Wed Nov 24 08:16:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 48051 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DB70D3858423 for ; Wed, 24 Nov 2021 08:16:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB70D3858423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1637741812; bh=lXQ9UfI8gm+eB48O1Cxo/prYeGw3R0Kz29z4T7W1JK4=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=C+QsNv77kkUIkHaJGhi2GLXAKUv2xYjdZCJlnORpI2FaVHRdQuLp2m5sNpXzr5GD3 4hTGjgpic5ENRm4LtgsToiVBbwvwb7D7IaCVwSFsic1I0y3Zs+i1YSaqYnatFeEVOX zqUpzVFt7Wu2qHsNB6K00rAfLbQ1VKpJdxHMRtF4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 A44B1385840B for ; Wed, 24 Nov 2021 08:16:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A44B1385840B Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-398-kZB2_VtNN3yyIK5kJBRm0Q-1; Wed, 24 Nov 2021 03:16:21 -0500 X-MC-Unique: kZB2_VtNN3yyIK5kJBRm0Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 527021006AA3 for ; Wed, 24 Nov 2021 08:16:20 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCF4A1000324; Wed, 24 Nov 2021 08:16:15 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 1AO8GDRt3985059 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 24 Nov 2021 09:16:13 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 1AO8GDuW3985058; Wed, 24 Nov 2021 09:16:13 +0100 Date: Wed, 24 Nov 2021 09:16:12 +0100 To: Jason Merrill Subject: [PATCH] c++: Return early in apply_late_template_attributes if there are no late attribs [PR101180] Message-ID: <20211124081612.GH2646553@tucnak> References: <20211119100624.GN2646553@tucnak> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" On Fri, Nov 19, 2021 at 10:40:50AM -0500, Jason Merrill wrote: > > Shall we also change the function so that it doesn't call > > cplus_decl_attributes if late_attrs is NULL [...]? > > Please. Here it is. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2021-11-24 Jakub Jelinek PR c++/101180 * pt.c (apply_late_template_attributes): Return early if there are no dependent attributes. Jakub --- gcc/cp/pt.c.jj 2021-11-22 10:07:01.360225139 +0100 +++ gcc/cp/pt.c 2021-11-23 11:23:16.808321905 +0100 @@ -11712,6 +11712,9 @@ apply_late_template_attributes (tree *de /* Apply any non-dependent attributes. */ *p = nondep; + if (nondep == attributes) + return true; + /* And then any dependent ones. */ tree late_attrs = NULL_TREE; tree *q = &late_attrs;