[Bug c++/108456] New: attribute deprecated on enum doesn't warn
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 18 18:45:14 GMT 2023
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.
More information about the Gcc-bugs
mailing list