public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108456] New: attribute deprecated on enum doesn't warn
@ 2023-01-18 18:45 mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: mpolacek at gcc dot gnu.org @ 2023-01-18 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108456
           Summary: attribute deprecated on enum doesn't warn
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

In this test:

struct S {
  enum [[deprecated]] E { D };
};

int main()
{
  auto a1 = S::D;
  auto a2 = S::E::D;
}

we emit a -Wdeprecated-declarations warning only for a2 but not a1, whereas
clang++ warns for a1 too (twice, in fact).  I suppose we want a warning there
as well.

C++20 using enum test:

enum class [[deprecated]] E { X };

int main()
{
    using enum E;
    auto a = X;
}

clang++ warns but g++ doesn't.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-18 18:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-18 18:45 [Bug c++/108456] New: attribute deprecated on enum doesn't warn mpolacek at gcc dot gnu.org

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).