This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13795] ternary operator fails to compile with static const class members
- From: "perry at kundert dot ca" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jan 2004 20:15:53 -0000
- Subject: [Bug c++/13795] ternary operator fails to compile with static const class members
- References: <20040121190611.13795.perry@kundert.ca>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From perry at kundert dot ca 2004-01-21 20:15 -------
> Note also that this has been fixed for 3.4 (i.e. despite the fact that
> the compiler is correct in requiring the definition, we dropped this
> requirement for 3.4).
Thanks for the reply! I searched for any indication of this, but bugzilla
returned no responses (at all) to any search for "static const"...
So, the Standard must say something different than what Stroustrup said in "The
C++ Programming Language", 3rd. ed., 10.4.6.2 Member Constants: "If (and only
if) you use an initialized member in a way that requires it to be stored as an
object in memory, the member must be (uniquely) defined somewhere." ?
I'm glad this is changed in 3.4; not a big deal (easy to work around), but it
would be nice if it matched Stroustrup (I don't have a copy of the Standard open
beside me...)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13795