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

Sylvestre Ledru via cfe-dev cfe-dev at lists.llvm.org
Tue Mar 20 15:40:29 PDT 2018


See:
https://bugs.llvm.org/show_bug.cgi?id=32012#c6

Hope this helps,
S


2018-03-20 23:23 GMT+01:00 Matthieu Brucher via cfe-dev
<cfe-dev at lists.llvm.org>:
> 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
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list