Fw: new requirement of "constexpr" for static const float data members is too restrictive

Roman Kononov roman@xtremedata.com
Mon Nov 29 22:47:00 GMT 2010


$ cat test.cc 
struct X { static float const v=1; };

$ g++ -c -std=gnu++0x test.cc 
test.cc:1:33: error: 'constexpr' needed for in-class initialization of
static data member 'v' of non-integral type

This will break a great deal of existing c++ code preventing easy
transition to c++0x. Maybe, the constexpr requirement should be relaxed
in gnu++0x mode.

Please see the trivial patch.

Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: constexpr-float.patch
Type: text/x-patch
Size: 561 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20101129/becc2ec8/attachment.bin>


More information about the Gcc mailing list