<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71852>71852</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] `readability-implicit-bool-conversion` gives inconsistent suggestions on return value
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
felix642
</td>
</tr>
</table>
<pre>
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.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VMGOozgU_BpzeUoEzyHAgUPS6Vz3sveVMQ94K8eObJNsLv3tK0iy3YnSOzOXQZYxolxUUXKpELi3RLXItyLfJWqMg_N1R4b_Wa8waVx7qf8cCMLY9xQiOxvAdSDWqSfVqoYNx8uCD0fDmuOicc4stLMn8oGdFesUOABb7WzgEMlGOA9k4ag82ThQ4ADKE6i2pRaigzgQeIqjt3BSZqQliHQn0s2kAaFzxrgz2x4OFAfXBjizMdDziaDlrqOJ9UErncgCdxPvBRoa1InmbwR1IDiry_JKf5vX6W3Mj2wjdM4JLAVWN0SxvS4A4K4z-pGE3N4Bu6-MNwr8EYfAcqbB6gXTo6rr_McYj2MU8rXyKU35FtzoNQn5LuRGCrnJUMgNnJW3bPtpeY8NPhODKUFYCPkOAgu2UWABIt_-VNr5bhpXbysQxRt895vmF_8hbpfI3z8-Pp4B2XeWyt9tCQCqZ1cvgnth639Mh6gi67-0ClHIt0mdvMHx7itAT5a8itQun-JO2lq2laxUQnW2rqo8L2RRJEPdpLJVZZZq6nCl0rIt1ilimaGqtMwanXCNKcosS6usytaZXJbFCquq0blsK9SpFquUDorN0pjTYel8n3AII9VFVuaYGNWQCXNtIGqjbL-I3F4E4lQjvp42LZqxD2KVGg4xfNJEjmYunC_b8t2vVMp03p9a5aGf7EOFJKM39RDjMUzHBfcC9z3HYWyW2h0E7idht9vi6N3fpKPA_Ww2CNzPfv8NAAD__yqTjpc">