[Bug c++/45082] Static const signed int class member causes undefined symbol.

redi at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Jul 26 16:37:00 GMT 2010



------- Comment #4 from redi at gcc dot gnu dot org  2010-07-26 16:37 -------
(In reply to comment #3)
> 
> If you only want it to be used as an integral constant, don't use it in a
> context that requires a variable (e.g. reference binding)

e.g.
   funky((int)myclass::BUFF_SIZE);

This means the reference binds to a temporary, not to your class variable, and
therefore the compiler only needs the value of BUFF_SIZE, not it's definition.


-- 


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



More information about the Gcc-bugs mailing list