[cfe-dev] [clang-tidy] Error when applying braces around single statement fix

Matthieu Brucher via cfe-dev cfe-dev at lists.llvm.org
Tue Mar 20 15:23:23 PDT 2018


No one has a clue or cares about this issue?

2018-03-17 9:50 GMT+00:00 Matthieu Brucher <matthieu.brucher at gmail.com>:

> Hi all,
>
> I don't know if this was reported before (I didn't see anything online),
> but the fix for this checker breaks code.
> For instance:
>
> for(int i = 0; i < size; ++i)
>   for(int j = 0; j < size; ++j)
>     do(i, j);
>
> is turned into:
> for(int i = 0; i < size; ++i) {
>   for(int j = 0; j < size; ++j) {
>     do(i, j);
>   }
>
> without the second (or third or fourth...) brace.
> I suspect this is because the identical diags are removed? Is this
> expected behavior? Or is there a way to fix these?
>
> Regards,
>
> Matthieu
> --
> Quantitative analyst, Ph.D.
> Blog: http://blog.audio-tk.com/
> LinkedIn: http://www.linkedin.com/in/matthieubrucher
>



-- 
Quantitative analyst, Ph.D.
Blog: http://blog.audio-tk.com/
LinkedIn: http://www.linkedin.com/in/matthieubrucher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180320/eb36833e/attachment.html>


More information about the cfe-dev mailing list