BUG: Std Violation of 9.4.2-4

Martin v. Loewis martin@mira.isdn.cs.tu-berlin.de
Sat Jul 31 23:33:00 GMT 1999


> In the above code the constant-initialization in the declaration
> of the float MAXF should be disallowed. And the definition down below
> is also required but it compiles fine with it commented out.

Thanks for your bug report. This is not a bug, though: If you compile
your code with -pedantic, the compiler says

a.cc:11: warning: ANSI C++ forbids initialization of member constant `MAXF' of non-integral type `float'

Please see the documentation for details of -pedantic. Also, not
requiring a definition is not an error: The members are not used (in
the sense of 3.2, [basic.def.odr]/2), so they do not need to be
defined.

Even if they were used (and thus must be defined), the compiler does
not need to diagnose a missing definition, according to
[basic.def.odr]/3.

Kind regards,
Martin



More information about the Gcc-bugs mailing list