From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by sourceware.org (Postfix) with ESMTP id E3FBE385BF86 for ; Mon, 23 Mar 2020 14:49:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E3FBE385BF86 Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-364-lxGF4musMvmm9BF5lEvwkQ-1; Mon, 23 Mar 2020 10:49:32 -0400 X-MC-Unique: lxGF4musMvmm9BF5lEvwkQ-1 Received: by mail-qt1-f200.google.com with SMTP id n89so13252826qte.15 for ; Mon, 23 Mar 2020 07:49:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8OqOrWdmKmkgzRI/MRbXUQvfmpTPpnjdT3x1zsAmksE=; b=j/ZlGGecJ9JZ+ZqLw/xBKuB2fA+IiiD1xGNCFelVQtPvVzDLSuNJY7h0xwcG+OueHJ yZHw+e2Z58XS6+Mw8T87p+LCNpb0k07IXcr96tpJix8ysdRCk9/gY2crxTf2C1XR35Zw oLzm6ITyL4FZBecvcvA6JITEuxszaSdk2YDgFoBYhLMcXb9S8QCjjGZK673X/2BKqRUd xxDOBEWVyZzIzIsMkwrZq9mjkENK2HM41/bptuA3ydVMft+KQZsFt3ejmEqFTknqgefw 1AbMu9p95sUc0Ucu5gEwbo3rZH20PSjnZZvsU+RJr/dLOeSPwyzkmynfRaireRqfIdvv h3Yw== X-Gm-Message-State: ANhLgQ25Nbbu6G13iLcyCXb7zUN3qnZ/Gp4D7i8fZbfpz2tm9ZQP5Yc5 jCMCILw2CKe+Yq9MOzLFj+HCeReZ8E2D+BvfTczPWK4wnrBxXLdkubbOnW3wafp4a8bVvmdJkDW I+FNwffaX2pG9zstEjg== X-Received: by 2002:a37:6115:: with SMTP id v21mr20329401qkb.43.1584974971035; Mon, 23 Mar 2020 07:49:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsWbeBJMmI8NY3OYrTUpcR4Y1PPsVJD41OAKe/A2Ks3poRdVHKZjK16cMCo8obRyxcTs3bGuA== X-Received: by 2002:a37:6115:: with SMTP id v21mr20329382qkb.43.1584974970741; Mon, 23 Mar 2020 07:49:30 -0700 (PDT) Received: from [192.168.1.148] (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id h46sm2786606qtc.84.2020.03.23.07.49.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Mar 2020 07:49:30 -0700 (PDT) Subject: Re: [PATCH] avoid -Wredundant-tags on a first declaration in use (PR 93824) To: Martin Sebor , gcc-patches References: <010f6d68-a64e-45a4-744e-c040a4ea94d6@redhat.com> <65013bfc-23c3-47fb-a58d-9ab802d1febb@gmail.com> <2698a399-4176-2b5f-a134-52a0d82c2121@redhat.com> <13b8faa9-74b1-6131-5dda-d4f34dfa8af0@gmail.com> <77dc94af-40f1-46fd-f3f4-ceb7e3afc4b6@gmail.com> <00f21176-ea92-937c-5c8a-c04d5d813257@redhat.com> <90a6aebc-8fef-0b96-cd2b-3234bd82b9a0@gmail.com> <2c553c0d-c0ac-88ba-2a85-12c523a9a164@redhat.com> <2744364d-e705-06f8-064a-5425ade11669@gmail.com> <1239c5f0-7ea7-e760-0b1c-1fe725a5e129@redhat.com> <48d42e59-64c4-6674-40a4-c786f9e504f4@gmail.com> <6775e196-9f97-6651-bc6a-ee6d4b7d16bc@gmail.com> From: Jason Merrill Message-ID: Date: Mon, 23 Mar 2020 10:49:29 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <6775e196-9f97-6651-bc6a-ee6d4b7d16bc@gmail.com> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-16.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 23 Mar 2020 14:49:35 -0000 On 3/21/20 5:59 PM, Martin Sebor wrote: > + /* Diagnose class/struct/union mismatches. IS_DECLARATION is false > + for alias definition. */ > + bool decl_class = (is_declaration > + && cp_parser_declares_only_class_p (parser)); > cp_parser_check_class_key (parser, key_loc, tag_type, type, false, > cp_parser_declares_only_class_p (parser)); Don't you need to use the new variable? Don't your testcases exercise this? > + /* When TYPE is the use of an implicit specialization of a previously > + declared template set TYPE_DECL to the type of the primary template > + for the specialization and look it up in CLASS2LOC below. For uses > + of explicit or partial specializations TYPE_DECL already points to > + the declaration of the specialization. > + IS_USE is clear so that the type of an implicit instantiation rather > + than that of a partial specialization is determined. */ > + type_decl = TREE_TYPE (type_decl); > + if (TREE_CODE (type_decl) != TEMPLATE_DECL) > + type_decl = TYPE_MAIN_DECL (type_decl); The comment is no longer relevant to the code. The remaining code also seems like it would have no effect; we already know type_decl is TYPE_MAIN_DECL (type). Jason