| Issue |
161318
|
| Summary |
[clang-tidy] Incorrect autofix ignoring the correct precedence
|
| Labels |
clang-tidy
|
| Assignees |
|
| Reporter |
ChuanqiXu9
|
Reproducer:
```
#include <stdint.h>
#include <iostream>
int main()
{
uint32_t val = -1;
size_t bytesOut = 1;
std::cout << std::hex << val << std::endl;
while(val >>=7) {
std::cout << std::hex << val << std::endl;
bytesOut++;
}
std::cout << bytesOut << std::endl;
}
```
with `readability-implicit-bool-conversion` check, it will be rewritten to:
```
while(val >>=7 != 0)
```
but `!=` has higher precedence, so it is actually:
```
while(val >>= (7!=))
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs