On Mon, Oct 24, 2011 at 12:46 PM, Jason Merrill <ja...@redhat.com> wrote: > On 10/24/2011 01:21 PM, Gabriel Dos Reis wrote: >> >> On Mon, Oct 24, 2011 at 9:53 AM, Jason Merrill<ja...@redhat.com> 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 accepted? > > Right, they will be inconsistent. But that consistency isn't relevant for > legacy code, which can't have list-initialization in SFINAE context.
yes, but how does the compiler distinguish a "legacy code" compiled under C++11 from non-legacy C++11 code? I have no problem with C++03 codes. I do not think they are affected. 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. It is wrong for a -Wflag to introduce that inconsistency in new codes. >