[PATCH] Add warning to clang-reorder-fields when dependencies of init-list exprs are violated
Alexander Shaposhnikov via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 22 00:25:34 PDT 2017
Hi, Sam,
many thanks for the patch,
I'm sorry I didn't notice it earlier.
Do you mind uploading your patch to Phabricator, see
https://llvm.org/docs/Phabricator.html for instructions,
so it would be easier to review / discuss the changes.
Kind regards,
Alexander Shaposhnikov
On Sun, Jul 9, 2017 at 2:11 PM, Sam Conrad via cfe-commits <
cfe-commits at lists.llvm.org> wrote:
> This adds a warning emitted by clang-reorder-fields when the reordering
> fields breaks dependencies in the initializer list (such that
> -Wuninitialized would warn). For example, given:
> Foo::Foo(int x)
> : a(x)
> , b(a) {}
>
> Reordering fields to [b,a] gives:
> Foo::Foo(int x)
> : b(a)
> , a(x) {}
>
> Emits the warning:
> 2: Warning: reordering field a after b makes a uninitialized when used in
> init expression.
>
> The patch also reformats a few lines that were over 80 columns wide.
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170722/646490d6/attachment.html>
More information about the cfe-commits
mailing list