[Bug c++/13795] ternary operator fails to compile with static const class members

perry at kundert dot ca gcc-bugzilla@gcc.gnu.org
Wed Jan 21 20:15:00 GMT 2004


------- 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



More information about the Gcc-bugs mailing list