[C++ Patch] PR 50810 (new try)

Gabriel Dos Reis gdr@integrable-solutions.net
Mon Oct 24 19:53:00 GMT 2011


On Mon, Oct 24, 2011 at 1:17 PM, Jason Merrill <jason@redhat.com> wrote:
> On 10/24/2011 02:13 PM, Gabriel Dos Reis wrote:
>> The problem is with C++11 codes.  There is no reason for them to be
>> subjected
>> to the inconsistency, especially for codes in header files that are
>> upgraded (beyond control of the end user) and included in "legacy" codes.
>> The "legacy" code may not have list-initialization in sfinae context, but
>> the upgraded header file may have, without the end user knowing.
>
> And that header is unaffected.  Only initialization outside SFINAE context
> is affected.

I am afraid I do not understand why the header will
not be affected.

What about (testcase)

     int f(char);
     double f(...);

     const int n = sizeof f({257});

?

>> It is wrong for a -Wflag to introduce that inconsistency in new codes.
>
> What would you suggest instead?

An -fflag.  If -fpermissive is too broad, then -flegacy-init or -flegacy



More information about the Gcc-patches mailing list