http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
--- Comment #4 from Sander Land 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 thought it was both. Still
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
--- Comment #2 from Sander Land 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() {
double b = -a;// undefined ref
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45829
Summary: Unary minus on static const class variable triggering
linker error
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3