| Issue |
71852
|
| Summary |
[clang-tidy] `readability-implicit-bool-conversion` gives inconsistent suggestions on return value
|
| Labels |
clang-tidy
|
| Assignees |
|
| Reporter |
felix642
|
The suggestions of `readability-implicit-bool-conversion` is inconsistent when parenthesis are added to the return value.
The 2 following methods will give different suggestions even if they behave the same way.
```
int foo()
{
return true;
}
int foo2()
{
return (true);
}
```
Output:
```
[<source>:3:12: warning: implicit conversion bool -> 'int' [readability-implicit-bool-conversion]]
4 | return true;
| ^~~~
| 1
[<source>:8:12: warning: implicit conversion bool -> 'int' [readability-implicit-bool-conversion]]
9 | return (true);
| ^
| static_cast<int>
2 warnings generated.
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs