[Bug c++/31904] fail to link to static const double

fang at csl dot cornell dot edu gcc-bugzilla@gcc.gnu.org
Sat May 12 08:06:00 GMT 2007



------- Comment #1 from fang at csl dot cornell dot edu  2007-05-12 09:06 -------
You need to define Base::x out of class in some translation unit, the in-class
declaration alone isn't enough, though sometimes the compiler will elide the
reference to it if its value is known (optimization).

const double Base::x = 1.0;


-- 

fang at csl dot cornell dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fang at csl dot cornell dot
                   |                            |edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31904



More information about the Gcc-bugs mailing list