Issue 71854
Summary [clang-tidy] `readability-implicit-bool-conversion` incorrectly applies fixes when both comparison and cast are needed
Labels clang-tidy
Assignees
Reporter felix642
    When applying fixes from `readability-implicit-bool-conversion`, the parenthesis are not properly added. 

```
#include <array>
int main()
{
    std::array<char, 4> bar;
    int myVal = 0;
 return bar[!myVal];
}
```  


````
#include <array>

int foo()
{
    std::array<char, 4> bar;
    int myVal = 0;
    return bar[static_cast<size_type>(myVal) == 0];
} 
```

godbolt: https://godbolt.org/z/Yx3qP1Wxh
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to