This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++4.0 diagnostic on casting a static const member initializer to a double
Matt Austern <austern@apple.com> writes:
[...]
| > The diagnostic could be better, but it is indeed accurate; if
| > there's an initializer it must be integral constant-expression, and
| > a cast to "double" cannot appear in such an expression.
|
| Hm, I think it's stretching it a bit to call that diagnostic accurate.
| The real user error is trying to initialize a static const double in
| the first place, not the details of what we're trying to initialize it
| with.
|
| You're right that this code is invalid, but I think your average user
| who gets this error message might be mystified about what's wrong.
100% agreed on both count.
-- Gaby