[Bug c++/45829] Unary minus on static const class variable triggering linker error

2010-09-30 Thread redi at gcc dot gnu.org
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?

[Bug c++/45829] Unary minus on static const class variable triggering linker error

2010-09-29 Thread rguenth at gcc dot gnu.org
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

[Bug c++/45829] Unary minus on static const class variable triggering linker error

2010-09-29 Thread sander.land at gmail dot com
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() {

[Bug c++/45829] Unary minus on static const class variable triggering linker error

2010-09-29 Thread rguenth at gcc dot gnu.org
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.

[Bug c++/45829] Unary minus on static const class variable triggering linker error

2010-09-29 Thread sander.land at gmail dot com
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

[Bug c++/45829] Unary minus on static const class variable triggering linker error

2010-09-29 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829 Paolo Carlini paolo.carlini at oracle dot com changed: What|Removed |Added CC|

[Bug c++/45829] Unary minus on static const class variable triggering linker error

2010-09-29 Thread manu at gcc dot gnu.org
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

[Bug c++/45829] Unary minus on static const class variable triggering linker error

2010-09-29 Thread redi at gcc dot gnu.org
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

[Bug c++/45829] Unary minus on static const class variable triggering linker error

2010-09-29 Thread manu at gcc dot gnu.org
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