On Sun, Oct 23, 2011 at 9:16 PM, Paolo Carlini <paolo.carl...@oracle.com> wrote:
> On 10/24/2011 04:10 AM, Gabriel Dos Reis wrote:
>>
>> Before the patch, -std=c++0x effectively put off -Wc++0x-compat because we
>> are compiling c++98/c++03 code, so we can only *warn* about possible
>> compatibility conflict with C++11. However, the narrowing diagnostic
>> required by C++11 is NOT a warning. It is a diagnostic. The way we alter a
>> standard mandate is through some -fflag, e.g. -fpermissive. What the above
>> patch fragment is doing is to turn on a *warning*. When -std=c++0x is in
>> effect, narrowing is no longer a warning. It is an error by default.
>
> I'm missing your point, I'm sorry: I maintain that *before* and after the
> patch -Wno-narrowing in C++0x mode was able to suppress the narrowing
> warnings.

and I am saying that is a bug.

> 'm 100% sure, I double checked for you one second ago. Are we on
> the same page on this? If we are, and you think gcc should do something new,

It is new only in the sense that a bug will be fixed.  Otherwise no,
it is not new.

> I have no problem changing my patch to, eg:
>
>  if (cxx_dialect == cxx0x)
>    {
>      /* If we're allowing C++0x constructs, don't warn about C++98
>     identifiers which are keywords in C++0x.  */
>      warn_cxx0x_compat = 0;
>      warn_narrowing = 1;
>    }

Yes, a -Wno-narrowing should not suppress narrowing in C++11 mode.

>  else if (warn_narrowing == -1)
>    warn_narrowing = 0;
>

OK.

Reply via email to