This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/44673] static const variable works in if/else, fails at linking in ternary



------- Comment #12 from manu at gcc dot gnu dot org  2010-06-26 10:35 -------
(In reply to comment #11)
> [class.static.data]/3
> If a static data member is of const literal type, its declaration in the class
> definition can specify a brace-or-equal-initializer ... The member shall
> still be defined in a namespace scope if it is used in the program and
> the namespace scope definition shall not contain an initializer.
> 
> [basic.def.odr] explains what "used" means.
> 
> The code is invalid, I don't think it does users a service to accept it.

So is g++ accepting invalid code?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44673


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]