https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104682
Bug ID: 104682 Summary: Missing deprecated warning on enumerator in class template 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: --- Here we only emit the "is deprecated" warning for S2::A, but not S<int>::A. Clang emits a warning for both. template<typename> struct S { enum { A __attribute__((deprecated)) }; }; struct S2 { enum { A __attribute__((deprecated)) }; }; void g () { auto a = S<int>::A; // { dg-warning "is deprecated" } auto b = S2::A; // { dg-warning "is deprecated" } } Not a regression.