https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58972
--- Comment #11 from Ville Voutilainen <ville.voutilainen at gmail dot com> --- Reduced further: class base { protected: typedef int type; }; template <typename T> class derive: public base { public: void foo() { struct f_t { f_t(base::type a) {} }; } }; int main() { derive<char> d; d.foo(); }