[Bug c++/37972] static variables of template class not emitted if no initializer given

rysto32 at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Oct 31 01:52:00 GMT 2008



------- Comment #2 from rysto32 at gmail dot com  2008-10-31 01:50 -------
Subject: Re:  static variables of template class not emitted if no initializer
given

What if I explicitly instantiate Base<int>?

template <typename T>
class Base
{
public:
     static int foo;
};

template class Base<int>;
template<> int Base<int>::foo;


g++ 3.4 emits Base<int>::foo, but 4.3.2 and 4.2.4 don't.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37972



More information about the Gcc-bugs mailing list