------- Comment #4 from redi at gcc dot gnu dot org 2009-12-08 09:50 ------- (In reply to comment #3) > (In reply to comment #2) > > and i don't want to write lots of "const int A<N>::i"... > > You have to, your code is not valid if you use A::i in the program but it has > no definition. This is not a compiler bug.
Actually you don't have to write lots, just one: template<int N> const A<N>::i; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42330