[Bug c++/44552] specialization of static const class member declaration should issue warning.
redi at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Jun 15 23:18:00 GMT 2010
------- Comment #3 from redi at gcc dot gnu dot org 2010-06-15 23:18 -------
It's true that your specialization is only a declaration, but this would be a
definition too:
template<>
const int MyTraits<int>::kValue = 1;
It's not true that the declaration has no purpose, it tells the compiler there
is an explicit specialization and the primary template should not be implicitly
instantiated.
That's exactly what's needed if an explicit specialization is defined in
another translation unit, otherwise you get multiple definitions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44552
More information about the Gcc-bugs
mailing list