This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11930] Cannot define static template struct member
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Aug 2003 18:11:35 -0000
- Subject: [Bug c++/11930] Cannot define static template struct member
- References: <20030815160749.11930.schnetter@uni-tuebingen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11930
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-15 18:11 -------
That is because you need to instantiate the template to get the variable emitted (or use it if on a
target that supports weak):
template<int D>
struct x {
static int a;
};
template struct x<0>;
template <> int x<0>::a;