http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
--- Comment #9 from Jonathan Wakely redi at gcc dot gnu.org 2010-09-30
08:10:39 UTC ---
(In reply to comment #8)
But -a (or 0.0-a) is not a constant expression, so having an in-class
initializer seems suspicious, couldn't we warn at least?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
Richard Guenther rguenth at gcc dot gnu.org changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
--- Comment #2 from Sander Land sander.land at gmail dot com 2010-09-29
12:49:23 UTC ---
I did define the constant, though now see the attachment apparently failed?
Full text below:
struct x {
static const double a = 3.14;
double f() {
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
--- Comment #3 from Richard Guenther rguenth at gcc dot gnu.org 2010-09-29
12:53:52 UTC ---
You didn't. A definition would be
const double x::a;
at file-scope. Your definition is a declaration.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
--- Comment #4 from Sander Land sander.land at gmail dot com 2010-09-29
13:05:45 UTC ---
(In reply to comment #3)
You didn't. A definition would be
const double x::a;
at file-scope. Your definition is a declaration.
Fair enough, I
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
Paolo Carlini paolo.carlini at oracle dot com changed:
What|Removed |Added
CC|
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
Manuel López-Ibáñez manu at gcc dot gnu.org changed:
What|Removed |Added
CC||manu at gcc
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
--- Comment #7 from Jonathan Wakely redi at gcc dot gnu.org 2010-09-29
22:59:39 UTC ---
(In reply to comment #6)
What is the point of allowing to initialize it then?
Static const members declared with initializers can be used in constant
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
--- Comment #8 from Manuel López-Ibáñez manu at gcc dot gnu.org 2010-09-29
23:22:59 UTC ---
(In reply to comment #7)
(In reply to comment #6)
What is the point of allowing to initialize it then?
Static const members declared with