https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60063
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-02-16 See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=79548 Summary|-Wunused-local-typedefs |[5/6/7 Regression] |warning despite attribute |-Wunused-local-typedefs |used in a template |warning despite attribute | |used in a template Ever confirmed|0 |1 --- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- No change in GCC 7. The -Wunused-local-typedefs warning is still issued inconsistently. The warning on the template is a regression from GCC 4.6 most likely introduced in r187757, along with bug 79548. $ cat u.C && gcc -S -Wall -Wextra -Wpedantic -Wunused u.C void foo () { typedef __attribute__ ((used)) int T; } template <class T> void bar () { typedef __attribute__ ((used)) T U; } u.C: In function ‘void bar()’: u.C:9:36: warning: typedef ‘U’ locally defined but not used [-Wunused-local-typedefs] typedef __attribute__ ((used)) T U; ^