[cfe-commits] [PATCH] Turn the c++0x-compat narrowing warning on by default, and fix clang

Jeffrey Yasskin jyasskin at google.com
Wed Jul 27 00:15:37 PDT 2011


On Wed, Jul 27, 2011 at 12:07 AM, Chandler Carruth <chandlerc at google.com> wrote:
> I'd request that this warning staff off by default for a while yet. This is
> likely to cause quite a bit of fallout and I think it'd be good to give
> people time to use the warning (with fixit hints) to adapt their code.

That's fine with me.

> Side note, in 0x mode, do the errors have the same fixit hints (and not on
> the note, recovering as if the fix were applied)?

The C++0x mode fixit hints are on notes, not on the errors, because
there's a decent chance that the user didn't actually intend to
narrow, or that the hint includes the wrong spelling of the type. We
need a "string_to_reference_type_from_context()" function to get that
spelling right.

The compiler continues after the error as if narrowing conversions
weren't an error.

> On Tue, Jul 26, 2011 at 11:51 PM, Jeffrey Yasskin <jyasskin at google.com>
> wrote:
>>
>> As the subject says. On some of the test cases, I could pass
>> -Wno-cxx0x-compat instead of changing types, if reviewers prefer.
>>
>> Jeffrey
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
>



More information about the cfe-commits mailing list