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] Poor diagnostic for deprecated alias-declaration
Date: Thu, 22 Jul 2021 09:47:51 +0000	[thread overview]
Message-ID: <bug-101015-4-ceJnEn9Rty@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101015-4@http.gcc.gnu.org/bugzilla/>

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=84360

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
namespace v2
{
  template<typename T> struct blargle { };
}

namespace v1
{
  template<typename _Tp>
    using blargle [[deprecated("use v2::blargle instead of v1::blargle")]]
      = v2::blargle<_Tp>;
}

v1::blargle<int> a;


da.C:13:18: warning: 'using blargle = struct v2::blargle<int>' is deprecated:
use v2::blargle instead of v1::blargle [-Wdeprecated-declarations]
   13 | v1::blargle<int> a;
      |                  ^
da.C:9:11: note: declared here
    9 |     using blargle [[deprecated("use v2::blargle instead of
v1::blargle")]]
      |           ^~~~~~~


The expanded using-declaration is especially unhelpful when it re-uses the same
name in a different namespace. It would be better to print the type including
its namespace qualification:

warning: 'v1::blargle' is deprecated: ...

Maybe related to PR 84360

      parent reply	other threads:[~2021-07-22  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 13:13 [Bug c++/101015] New: " redi at gcc dot gnu.org
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 [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=bug-101015-4-ceJnEn9Rty@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).