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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Louis Dionne via cfe-dev
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
--

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [clang-tidy] Error when applying braces around single statement fix

Louis Dionne via cfe-dev
No one has a clue or cares about this issue?

2018-03-17 9:50 GMT+00:00 Matthieu Brucher <[hidden email]>:
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
--



--

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [clang-tidy] Error when applying braces around single statement fix

Louis Dionne via cfe-dev
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
<[hidden email]>:

> No one has a clue or cares about this issue?
>
> 2018-03-17 9:50 GMT+00:00 Matthieu Brucher <[hidden email]>:
>>
>> 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
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [clang-tidy] Error when applying braces around single statement fix

Louis Dionne via cfe-dev
Indeed, thanks... Seems like this _big_ bug has not seen that much attention :(

2018-03-20 22:40 GMT+00:00 Sylvestre Ledru <[hidden email]>:
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
<[hidden email]>:
> No one has a clue or cares about this issue?
>
> 2018-03-17 9:50 GMT+00:00 Matthieu Brucher <[hidden email]>:
>>
>> 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
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



--

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev