public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marek Polacek <polacek@redhat.com>
To: Iain Sandoe <iain@sandoe.co.uk>
Cc: Jason Merrill <jason@redhat.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] c++: Lost deprecated/unavailable attr in class tmpl [PR104682]
Date: Mon, 28 Feb 2022 11:31:17 -0500	[thread overview]
Message-ID: <Yhz41W4GzC5gkHIC@redhat.com> (raw)
In-Reply-To: <259EEC2B-37C4-468B-80FD-B05850FA72EA@sandoe.co.uk>

On Mon, Feb 28, 2022 at 04:30:01PM +0000, Iain Sandoe wrote:
> 
> 
> > On 28 Feb 2022, at 16:13, Jason Merrill <jason@redhat.com> 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


      reply	other threads:[~2022-02-28 16:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 21:59 Marek Polacek
2022-02-28 16:13 ` Jason Merrill
2022-02-28 16:18   ` Marek Polacek
2022-02-28 16:30   ` Iain Sandoe
2022-02-28 16:31     ` Marek Polacek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yhz41W4GzC5gkHIC@redhat.com \
    --to=polacek@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iain@sandoe.co.uk \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).