[Patch] Better diagnostics for string initialization (and fix for C11)

Hans Wennborg hans at chromium.org
Tue May 14 03:08:47 PDT 2013


Thanks for the review Richard!

On Mon, May 13, 2013 at 8:48 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Mon, May 13, 2013 at 9:49 AM, Hans Wennborg <hans at chromium.org> wrote:
>> The attached patch fixes Clang's diagnostics concerning string
>> initialization.
>
> Looks good, but how about changing IsStringInit to return a
> StringInitFailureKind value? I think the two places which use its return
> value rather than just using the same Expr* they passed in are actually
> wrong (they pass the IgnoreParens'd version of the return value to
> CheckStringInit rather than passing in the original expression, and thus may
> fail to update the type on the parens).

Sounds good to me. Attaching new patch.

OK to commit?

Thanks,
Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: string-init-diags2.patch
Type: application/octet-stream
Size: 18697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130514/0d963c19/attachment.obj>


More information about the cfe-commits mailing list