This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36261] Static const member data not found when used in a template
- From: "paolo dot carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 May 2008 00:16:24 -0000
- Subject: [Bug c++/36261] Static const member data not found when used in a template
- References: <bug-36261-13849@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from paolo dot carlini at oracle dot com 2008-05-19 00:16 -------
And you are certainly wrong that the Standard allows to omit the definition, in
this case. This is 9.4.2/4 oc C++03, note the last sentence:
If a static data member is of const integral or const enumeration type, its
declaration in the class definition can specify aconstant-initializer which
shall be an integral constant expression (5.19). In that case, the member can
appear in integral constant expressions. The member shall still be defined in a
name-space scope if it is used in the program and the namespace scope
definition shall not contain aninitializer.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36261