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 236223858C83 for ; Mon, 28 Feb 2022 16:31:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 236223858C83 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-359-XLWW2m0BMtmE5X_olW5gyQ-1; Mon, 28 Feb 2022 11:31:20 -0500 X-MC-Unique: XLWW2m0BMtmE5X_olW5gyQ-1 Received: by mail-qv1-f70.google.com with SMTP id fv11-20020a056214240b00b0043253a948f0so12563762qvb.1 for ; Mon, 28 Feb 2022 08:31:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=91gKgMV1V5R+SGyGzT+bFbomYnnTAkmf8uc6mAjC1SA=; b=I9MeuKWD1fbGtg3bG3Sx3ieLzsRaKENmXdO/Pn94+p6Hsfw7EN0uRIhfNgkC8PzqG9 BFNGns528ifBiryi22nVCsigvpH7wCg8IwOz/pPcYPGt4La5jpH7R+SDUPjW67bgrGk7 OxNZIZ9w7diQ6hGTxKLBaGsNeBZSAAu4B+1VZMyalUaWm0vU4gMvusogAgqiuJeJvehS pxzyRUZ4N4suTnymTzFfrHX4kKIqm1erxE49JqQRLNYKwcFzVkBoMvgr/xRdIVQtY1fj HM2Se06CWY+x0XrVTwk7evh9EtrlwAH+LsaMS4DDXpP1LSpEbTALplmA97ScNjg/7KWc jSRw== X-Gm-Message-State: AOAM53143IKRPFk4eAkyImnoVuLB/AwcFM+jjFL2VwZ0qQyWOjlv4F7Y A6hKYnbeTTGxMVd9AZAllwrTab5UkoXvRc2zqFnprU0Nxe7ONGC53PKzFsJnZA6PeKPp9IkJTvM FViabsowPjCsTcsLm1w== X-Received: by 2002:a05:622a:5c9:b0:2de:71c:5aa7 with SMTP id d9-20020a05622a05c900b002de071c5aa7mr17311018qtb.207.1646065879688; Mon, 28 Feb 2022 08:31:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzVkXOpIviJHaaKG3NqoIhQBYGJe0IxmWRumzoOOIEJBEZxO3nBrdP0o2ySxH1fSl9eCPxQw== X-Received: by 2002:a05:622a:5c9:b0:2de:71c:5aa7 with SMTP id d9-20020a05622a05c900b002de071c5aa7mr17311008qtb.207.1646065879511; Mon, 28 Feb 2022 08:31:19 -0800 (PST) Received: from redhat.com ([2601:184:4780:4310::3f37]) by smtp.gmail.com with ESMTPSA id v1-20020a05622a130100b002de7e96aa7asm7186616qtk.79.2022.02.28.08.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 08:31:19 -0800 (PST) Date: Mon, 28 Feb 2022 11:31:17 -0500 From: Marek Polacek To: Iain Sandoe Cc: Jason Merrill , GCC Patches Subject: Re: [PATCH] c++: Lost deprecated/unavailable attr in class tmpl [PR104682] Message-ID: References: <20220225215921.324060-1-polacek@redhat.com> <97974b6a-98ec-6753-07ea-ff96ba15e92f@redhat.com> <259EEC2B-37C4-468B-80FD-B05850FA72EA@sandoe.co.uk> MIME-Version: 1.0 In-Reply-To: <259EEC2B-37C4-468B-80FD-B05850FA72EA@sandoe.co.uk> User-Agent: Mutt/2.1.5 (2021-12-30) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.9 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_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Mon, 28 Feb 2022 16:31:23 -0000 On Mon, Feb 28, 2022 at 04:30:01PM +0000, Iain Sandoe wrote: > > > > On 28 Feb 2022, at 16:13, Jason Merrill wrote: > > > > On 2/25/22 17:59, Marek Polacek wrote: > >> [ Most likely a GCC 13 patch, but I'm posting it now so that I don't lose it. ] > >> When looking into the other PR I noticed that we fail to give a warning > >> for a deprecated enumerator when the enum is in a class template. This > >> only happens when the attribute doesn't have an argument. The reason is > >> that when we tsubst_enum, we create a new enumerator: > >> build_enumerator (DECL_NAME (decl), value, newtag, > >> DECL_ATTRIBUTES (decl), DECL_SOURCE_LOCATION (decl)); > >> but DECL_ATTRIBUTES (decl) is null when the attribute was provided > >> without an argument -- in that case it simply melts into a tree flag. > >> handle_deprecated_attribute has: > >> if (!args) > >> *no_add_attrs = true; > >> so the attribute isn't retained and we lose it when tsubsting. Same > >> thing when the attribute is on the enum itself. > >> Attribute unavailable is a similar case, but it's different in that > >> it can be a late attribute whereas "deprecated" can't: > > > > Iain, was this difference intentional? > > The intent was to treat the two attributes the same way - so any difference > is unintentional. Thanks. I'll send a patch soon. Marek