http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59004
Daniel Krügler <daniel.kruegler at googlemail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.kruegler@googlemail. | |com --- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> --- Let me add that the code itself is invalid, because the local name x hides the template parameter name x. A revised valid code example: //------------------- template<int z> class A {}; template<int x> class B { public: static const int y = (x != -1 ? 0 : 0); template<int z> void g(const A<y> &a) { const char *x2 = __func__; } }; template void B<0>::g<0>(const A<0> &); //------------------- The problem still exists in 4.8.2 but seems to be fixed in 4.9.0 trunk.