public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/101015] New: Poor diagnostic for deprecated alias-declaration
Date: Thu, 10 Jun 2021 13:13:01 +0000	[thread overview]
Message-ID: <bug-101015-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101015

            Bug ID: 101015
           Summary: Poor diagnostic for deprecated alias-declaration
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

struct A {
  typedef int good [[deprecated]];
  using bad [[deprecated]] = int;
};

A::good i = 0;
A::bad j = 0;

This prints:

depr.C:6:9: warning: 'A::good' is deprecated [-Wdeprecated-declarations]
    6 | A::good i = 0;
      |         ^
depr.C:2:15: note: declared here
    2 |   typedef int good [[deprecated]];
      |               ^~~~
depr.C:7:8: warning: 'using bad = int' is deprecated
[-Wdeprecated-declarations]
    7 | A::bad j = 0;
      |        ^
depr.C:3:9: note: declared here
    3 |   using bad [[deprecated]] = int;
      |         ^~~


When it is good it is very very good, but when it is bad it is horrid.

The second warning should print 'A::bad' not 'using bad = int'.

             reply	other threads:[~2021-06-10 13:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 13:13 redi at gcc dot gnu.org [this message]
2021-06-10 13:44 ` [Bug c++/101015] " mpolacek at gcc dot gnu.org
2021-06-11 15:50 ` mpolacek at gcc dot gnu.org
2021-07-22  9:47 ` redi at gcc dot gnu.org

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=bug-101015-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).