https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63872
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- Smaller testcase: template<typename T> T make() { return { typename T::type{0} }; } void f() { struct X { using type = int; X(int) { } }; make<X>(); } local.cc: In function ‘void f()’: local.cc:10:21: warning: typedef ‘using type = int’ locally defined but not used [-Wunused-local-typedefs] using type = int; ^ As stated in comment 0, this causes warnings for types with 'allocator_type' or 'is_transparent' typedefs, which get used indirectly by standard library components and removing them would still compile but with different semantics. Adding __attribute__((unused)) or [[maybe_unused]] does work, but shouldn't be necessary.