http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47144
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-01 18:24:42 UTC --- (In reply to comment #2) > > what 4.6.0 version are you using? > > Hmm, "4.6.0 20101113 (experimental)". Ah, maybe that accepted it, but current 4.6 rejects it. I assume it was changed by Nathan Froyd's recent changes to diagnostics about missing ';' after a class definition. > I found the following does not error out > on 4.1.2: > > template<typename T> struct A { }; > > template<typename T> > struct C { > typename A< struct B { } >::A x; > }; > > C<int> c; This is accepted by 4.4 and 4.5 but rejected by 4.6 (noone cares about 4.1, it's been unmaintained for some time) > Maybe it also works on 4.4. Note that this relies on "typename X::Y" to ignore > non-type names, which I think is not according to the spec. See > http://stackoverflow.com/questions/4420828/another-bug-in-g-clang-c-templates-are-fun > and http://llvm.org/bugs/show_bug.cgi?id=8263 .