https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66564
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced testcase: template<typename Args> struct A { template<typename> struct B {}; }; template<> template<typename Args> struct A<Args>::B<Args> {}; int main() { A<int>::B<int> b; } Without the definition of b in main, we accept the invalid code.