[Bug c++/50258] [C++0x] -std=gnu++0x should allow in-class initialization of static const floating types without constexpr

bsys.com.ar at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Sep 29 10:46:00 GMT 2011


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

Carlos Becker <bsys.com.ar at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bsys.com.ar at gmail dot
                   |                            |com

--- Comment #9 from Carlos Becker <bsys.com.ar at gmail dot com> 2011-09-29 10:31:15 UTC ---
Hello, thanks for taking care of this 'bug'.
I am currently working with ITK (www.itk.org) which doesn't compile with
-std=c++0x in gcc 4.6.1 due to this error.

Even though the proposed patch seems to be a proper solution, to me it seems to
be that using -fpermissive just to come around this particular error is
allowing other non-confirming code to compile as well, which may not be desired
in many situations (for instance, assigning a const pointer to a non-const
pointer would not be regarded as an error).

In my case, I have modified the patch to throw a warning instead, but probably
the best solution would be to add a sort of -fno-constexpr-initialization-check
flag. I read that the previous GCC extension is deprecated now, but it is
important to take into account that then it would be hard to use c++11 with
older code, just because of details like this one.

Thank you.



More information about the Gcc-bugs mailing list