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