https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61596
Bug ID: 61596 Summary: -Wunused-local-typedefs warns incorrectly on a typedef that's referenced indirectly Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: thakis at chromium dot org -Wunused-local-typedefs warns that the typedef in line "XXX" is unused, but it's used in line "YYY": auto f() { struct S { typedef int t; // XXX }; return S(); } void g() { auto x = f(); decltype(x)::t y; // YYY } /example.cpp: In function ‘auto f()’: 2 : warning: typedef ‘f()::S::t’ locally defined but not used [-Wunused-local-typedefs] struct S { typedef int t; }; ^ (This is with 4.9.0. Testcase from Richard Smith.)