------- Comment #2 from aijunbai at gmail dot com 2009-12-08 09:46 ------- (In reply to comment #1) > You aren't defining anywhere A::i, just add, after struct A: > > const int A::i; > > and things will be fine. > > *** This bug has been marked as a duplicate of 42101 *** >
thanks for your reply. i found that no errors will be reported if i delete the line `bar(A::i)', so is that a bug? in fact the original code is like: template <int> class A { static const int i = -1; } template <> class A<0> { static const int i = 0; } //and some other specializations... and i don't want to write lots of "const int A<N>::i"... -- aijunbai at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|DUPLICATE | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42330