This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug regression/26355] defining static members of specialized template classes doesn't work
- 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: 19 Feb 2006 16:38:30 -0000
- Subject: [Bug regression/26355] defining static members of specialized template classes doesn't work
- References: <bug-26355-12203@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from rguenth at gcc dot gnu dot org 2006-02-19 16:38 -------
You need to add an initializer to make
template <> int Data<V1>::Value;
a definition. Otherwise it's just an explicit specialization decl. Or
if you do not want to specialize for V1, use
template <V v> int Data<v>::Value;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26355