http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59044
--- Comment #4 from Tom De Caluwé <decaluwe.t at gmail dot com> --- However the following code seems to be valid but results in the same ICE: /* ---- bug.cpp --------------------------------------- */ namespace N { template <class T> class C { private: template <T a, T b> struct Implementation {}; public: typedef typename Implementation<0, 0>::Typedef Type; }; template <class T> template <T b> struct C<T>::Implementation<0, b> { typedef void Typedef; }; } template class N::C<unsigned>; /* ---------------------------------------------------- */