http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45964
--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> 2010-10-11 15:20:47 UTC --- (In reply to comment #10) > Reduced form, Jason, are the "should be" comments below correct? > > // should be rejected, value is not a template > template<int a> > const int A<a>::template value = 0; Yes. > // should be accepted, B<b> is a template > template<int a> > template<int b> > const int A<a>::template B<b>::value = 0; Apparently so. I'm surprised by this; I didn't think you could use 'template' in a declarator-id, but I can't find anything in the WP to back that up.