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

2011-10-24 Thread Gabriel Dos Reis
On Mon, Oct 24, 2011 at 2:05 PM, Jason Merrill wrote: > On 10/24/2011 02:47 PM, Gabriel Dos Reis wrote: >> >> What about (testcase) >> >>      int f(char); >>      double f(...); >> >>      const int n = sizeof f({257}); >> >> ? > > The narrowing conversion would be marked as 'bad' and therefore t

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

2011-10-24 Thread Jason Merrill
On 10/24/2011 02:47 PM, Gabriel Dos Reis wrote: What about (testcase) int f(char); double f(...); const int n = sizeof f({257}); ? The narrowing conversion would be marked as 'bad' and therefore the second overload chosen. As before, the objective is to only change the d

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

2011-10-24 Thread Gabriel Dos Reis
On Mon, Oct 24, 2011 at 1:17 PM, Jason Merrill 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

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

2011-10-24 Thread Jason Merrill
On 10/24/2011 02:13 PM, Gabriel Dos Reis wrote: yes, but how does the compiler distinguish a "legacy code" compiled under C++11 from non-legacy C++11 code? It doesn't. The problem is with C++11 codes. There is no reason for them to be subjected to the inconsistency, especially for codes in h

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

2011-10-24 Thread Gabriel Dos Reis
On Mon, Oct 24, 2011 at 12:46 PM, Jason Merrill wrote: > On 10/24/2011 01:21 PM, Gabriel Dos Reis wrote: >> >> On Mon, Oct 24, 2011 at 9:53 AM, Jason Merrill  wrote: >> So, if you make -Wno-narrowing meaningful in C++11 mode then how can >> it not affect sfinae (case 1.b.) and still be consistent

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

2011-10-24 Thread Jason Merrill
On 10/24/2011 01:21 PM, Gabriel Dos Reis wrote: On Mon, Oct 24, 2011 at 9:53 AM, Jason Merrill wrote: So, if you make -Wno-narrowing meaningful in C++11 mode then how can it not affect sfinae (case 1.b.) and still be consistent with the other case where a diagnostic is required the expression ac

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

2011-10-24 Thread Gabriel Dos Reis
On Mon, Oct 24, 2011 at 9:53 AM, Jason Merrill wrote: > On 10/24/2011 10:39 AM, Gabriel Dos Reis wrote: >> >> Hmm, the narrowing semantics also affects SFINAE, not just simple >> declaration. >> If we want a flag that can also affect the outcome of overload >> resolution, it should one of the the

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

2011-10-24 Thread Jason Merrill
On 10/24/2011 10:39 AM, Gabriel Dos Reis wrote: Hmm, the narrowing semantics also affects SFINAE, not just simple declaration. If we want a flag that can also affect the outcome of overload resolution, it should one of the the -fflags, such as -fpermissive. I don't want the option to affect SFI

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

2011-10-24 Thread Gabriel Dos Reis
On Mon, Oct 24, 2011 at 9:10 AM, Jason Merrill wrote: > On 10/24/2011 09:49 AM, Gabriel Dos Reis wrote: >> >> On Mon, Oct 24, 2011 at 8:29 AM, Jason Merrill  wrote: >>> >>> Right, -Wno-long-long is only useful in C++03 and C90.  But it does in >>> fact >>> suppress a standard diagnostic. >> >> a d

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

2011-10-24 Thread Jason Merrill
On 10/24/2011 09:49 AM, Gabriel Dos Reis wrote: On Mon, Oct 24, 2011 at 8:29 AM, Jason Merrill wrote: Right, -Wno-long-long is only useful in C++03 and C90. But it does in fact suppress a standard diagnostic. a diagnostic of an extension :-) I'm not going to argue semantics any further. W

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

2011-10-24 Thread Gabriel Dos Reis
On Mon, Oct 24, 2011 at 8:29 AM, Jason Merrill wrote: > On 10/24/2011 09:26 AM, Gabriel Dos Reis wrote: >> >> On Mon, Oct 24, 2011 at 8:06 AM, Jason Merrill  wrote: > >>> No.  I added -Wno-narrowing specifically to suppress the diagnostic in >>> C++0x >>> mode; see c++/49793.  There are several di

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

2011-10-24 Thread Paolo Carlini
.. just to let you know guys, I'm already unassigned from the PR, but today I wanted to give it one (actually 3) more try. Given the controversy, I don't feel like further following the issue, it just makes me nervous. Eventually, feel free to adjust my patches to your likes. Paolo.

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

2011-10-24 Thread Jason Merrill
On 10/24/2011 09:26 AM, Gabriel Dos Reis wrote: On Mon, Oct 24, 2011 at 8:06 AM, Jason Merrill wrote: No. I added -Wno-narrowing specifically to suppress the diagnostic in C++0x mode; see c++/49793. There are several diagnostics required by standards that can be suppressed by -Wno- flags, s

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

2011-10-24 Thread Gabriel Dos Reis
On Mon, Oct 24, 2011 at 8:06 AM, Jason Merrill wrote: > On 10/24/2011 07:47 AM, Paolo Carlini wrote: [...] >> and also, as >> requested by Gaby, preventing -Wno-narrowing from suppressing the >> warning in C++0x mode (if the user really needs to silence it, >> -Wno-c++0x-compat works). I also adde

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

2011-10-24 Thread Jason Merrill
On 10/24/2011 09:06 AM, Jason Merrill wrote: On 10/24/2011 07:47 AM, Paolo Carlini wrote: the below is a new variant removing -Wc++0x-compat from -Wall (cannot be added to -Wextra either because bootstrap passes -W) I don't understand the rationale for this. If the warning is problematic for b

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

2011-10-24 Thread Jason Merrill
On 10/24/2011 07:47 AM, Paolo Carlini wrote: the below is a new variant removing -Wc++0x-compat from -Wall (cannot be added to -Wextra either because bootstrap passes -W) I don't understand the rationale for this. If the warning is problematic for bootstrap, why not just add -Wno-narrowing to

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

2011-10-24 Thread Gabriel Dos Reis
On Mon, Oct 24, 2011 at 7:18 AM, Paolo Carlini wrote: > Hi, >> >> On Mon, Oct 24, 2011 at 6:47 AM, Paolo Carlini >>  wrote: >>> >>> Hi, >>> >>> the below is a new variant removing -Wc++0x-compat from -Wall (cannot be >>> added to -Wextra either because bootstrap passes -W) and also, as >>> request

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

2011-10-24 Thread Paolo Carlini
On 10/24/2011 02:18 PM, Paolo Carlini wrote: OK with a minor correction. This bit +With -std=c++0x, @option{-Wno-c++0x-compat} can be used to suppress +the diagnostic required by the standard. should not be there. It is currently an accident of implementation detail as opposed to a feature.

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

2011-10-24 Thread Paolo Carlini
Hi, On Mon, Oct 24, 2011 at 6:47 AM, Paolo Carlini wrote: Hi, the below is a new variant removing -Wc++0x-compat from -Wall (cannot be added to -Wextra either because bootstrap passes -W) and also, as requested by Gaby, preventing -Wno-narrowing from suppressing the warning in C++0x mode (if t

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

2011-10-24 Thread Gabriel Dos Reis
On Mon, Oct 24, 2011 at 6:47 AM, Paolo Carlini wrote: > Hi, > > the below is a new variant removing -Wc++0x-compat from -Wall (cannot be > added to -Wextra either because bootstrap passes -W) and also, as requested > by Gaby, preventing -Wno-narrowing from suppressing the warning in C++0x > mode (

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

2011-10-24 Thread Paolo Carlini
Hi, the below is a new variant removing -Wc++0x-compat from -Wall (cannot be added to -Wextra either because bootstrap passes -W) and also, as requested by Gaby, preventing -Wno-narrowing from suppressing the warning in C++0x mode (if the user really needs to silence it, -Wno-c++0x-compat wor