This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11393] Initializer of static const float class member is not legal in c++98
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Oct 2012 02:13:23 +0000
- Subject: [Bug c++/11393] Initializer of static const float class member is not legal in c++98
- Auto-submitted: auto-generated
- References: <bug-11393-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11393
--- Comment #28 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-26 02:13:23 UTC ---
(In reply to comment #27)
> And for similar reasons, it seems wrong to reject "b" with a permerror: The
> code is accepted in c++98 as an extension, so it could be equally accepted in
> c++11 as an extension, and warned by -pedantic. No need to force users to use
> constexpr
Why not?
C++11 offers a portable alternative, there is no reason to use a deprecated
extension when you can use constexpr. It's an extension in C++98 because there
is no other way to write the code. Supporting the extension in C++11 is wrong,
the portable, standard feature should be used instead.
> Again, this is what clang does, which makes perfect sense to me.
I guess clang supports it for GCC compatibility, not because it's a good idea
that we should copy.
> So, I still see two bugs.
Your "c" example seems like a completely separate issue that should be a
separate PR, I don't understand why it's being discussed here.