Fw: new requirement of "constexpr" for static const float data members is too restrictive
Ian Lance Taylor
iant@google.com
Tue Nov 30 19:51:00 GMT 2010
Andrew Pinski <pinskia@gmail.com> writes:
> On Mon, Nov 29, 2010 at 4:20 PM, Ian Lance Taylor <iant@google.com> wrote:
>> We could decide not to do anything about this, but I don't think it's a
>> non-issue. With -std=gnu++98 g++ accepts this invalid code. That is,
>> it is a g++ extension, and the code is properly rejected with
>> -pedantic-errors. We could decide to carry the extension forward to
>> -std=gnu++0x. Or we could decide to carry the extension forward to
>> -std=gnu++0x when -fpermissive is used. Or we could decide to just drop
>> the extension.
>>
>> The main problem with the last option is that it complicates the
>> migration of existing gnu++98 programs to gnu++0x. It becomes necessary
>> to add constexpr to use gnu++0x. Unfortunately, gnu++98 rejects
>> constexpr. So there is no simple way to modify this program to be both
>> valid gnu++98 and valid gnu++0x. That makes the transition more
>> difficult.
>>
>> It seems to me that it would be better for our users to accept this code
>> in gnu++0x mode with -fpermissive.
>
> Except it is documented as a Deprecated feature already so it is
> different from a documented extension. I would say we should just
> drop it as it is documented already as deprecated.
I don't think it is very helpful for us to drop a deprecated feature
which we don't even warn about.
If we take this path, can somebody write a patch for 4.6 to add a
-Wdeprecated warning for this?
Ian
More information about the Gcc
mailing list