This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37972] static variables of template class not emitted if no initializer given
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Oct 2008 11:36:53 -0000
- Subject: [Bug c++/37972] static variables of template class not emitted if no initializer given
- References: <bug-37972-16881@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenth at gcc dot gnu dot org 2008-10-31 11:36 -------
Because you instantiate Base<int> which is not a specialization yet. Then
you define foo for a specialization which is not instantiated. You want
template <typename T>
int Base<T>::foo;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37972