This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/9048] Conditional expression error with static const members
- From: "hull at paracel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Mar 2004 23:35:36 -0000
- Subject: [Bug c++/9048] Conditional expression error with static const members
- References: <20021223143600.9048.jmc@xisl.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From hull at paracel dot com 2004-03-18 23:35 -------
I just ran into this bug.
By my reading of the C++ standard, I do not believe that an out-of-definition
should be necessary for a "static const int" class variable. See Section
9.4.2 "Static data members", specifically paragraph 4.
It is true that the bug can be worked around by turning the conditional
expression "a = (c ? X : Y)" into "if (c) { a = X; } else { a = Y; }".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9048