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