[cfe-commits] r153008 - in /cfe/trunk: lib/Sema/SemaFixItUtils.cpp test/FixIt/fixit-vexing-parse-cxx0x.cpp test/FixIt/fixit-vexing-parse.cpp

David Blaikie dblaikie at gmail.com
Sun Mar 18 11:02:34 PDT 2012

On Sun, Mar 18, 2012 at 9:28 AM, Sebastian Redl
<sebastian.redl at getdesigned.at> wrote:
> On 18.03.2012, at 03:56, David Blaikie wrote:
>> Author: dblaikie
>> Date: Sat Mar 17 21:56:47 2012
>> New Revision: 153008
>> URL: http://llvm.org/viewvc/llvm-project?rev=153008&view=rev
>> Log:
>> Use character literals for vexing initialization fixit hints.
>> Instead of suggesting " = 0" for "char c();", suggest " = '\0'", and similarly
>> for other char types (wide, 16, and 32). Add tests for all these, and since
>> this means testing such hints under C++0x, add tests for some untested C++0x
>> hint cases in the existing code, including suggesting nullptr for pointer
>> initialization.
> Shouldn't we just hint to {} in C++11?

Certainly a possibility. While I'm certainly in favor of suggesting
what would be the "canonical" code in C++11 when compiling as such,
I'm less familiar with certain features or how they will be/are used
at the moment (nullptr, for example, is a relatively easy one - so I
made the change a while ago to suggest that in C++11). I'm also not
sure how it'd interact with the change I wanted to build on top of
this, where we might need these initialization expressions outside the
context of an assignment. (see the patch I've sent for review to add a
fixit to null-conversion)

- David

More information about the cfe-commits mailing list