Template static member bug

Oskar Enoksson osken393@student.liu.se
Tue Feb 2 19:56:00 GMT 1999


I have found another template class static member bug (I don't think it
has been reported before, but I'm not sure). 

The bug is in both egcs 1.1.1 and in egcs-2.93.03. My platform is
alphaev56-dec-osf4.0d

Regards.
/Oskar Enoksson

//////// Begin test.cpp ////////
template<int N>
class A {
public:
  static const char * classname;
};

template<int N>
const char * A<N>::classname="Foo";

const char *test() {
  return A<3>::classname;
}
//////// End test.cpp /////////

> c++ -o foo foo.cpp
  /usr/bin/ld:
  Unresolved:
  A<3>::classname  
  collect2: ld returned 1 exit status


*/              Oskar Enoksson, Linkoping, Sweden                  /*



More information about the Gcc-bugs mailing list