<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63450>63450</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] More fine-grained options for readability-implicit-bool-conversion
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
chrchr-github
</td>
</tr>
</table>
<pre>
~~~c++
enum E : long { E0, E1 };
E f();
bool g(int i, double d) {
if (i) {}
if (d) {}
return f();
}
~~~
In the code above, three instances of readability-implicit-bool-conversion are detected. However, in some code bases, similar `if` conditions are very common and do not cause issues, whereas conversion from an enum might be a serious bug.
It would be nice to have more control over readability-implicit-bool-conversion warnings by either type involved (enum vs numerical) or usage (`if` vs `return`).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU8GOqzgQ_BpzaRE5JkA4cJjZJNo97EcYu4FeGXdkG6Jc8u0rJ3mzqzeXkZBA3eVydRWtY6TJI_ai_hT1qdBrmjn0Zg5mDuVEaV6HYmB77x-PhxHqMz_yJOQH-nWBM4jqAxz7CUT7CWcp1B9w3oNoT6J6A88wCnUUqvuqDMwOJqGO5BNQPmJ5HRyCFarLRC8YAACNkHG_6u3p95b91gqY1uC_XfoFeDwer4-_PKQZwbBF0ANvmJWkOSAC-Zi0NxiBRwiorR7IUbqXtFwdGUplnqE07DcMkdiDDggWE5qEdgd_8g03DJmQPERe3tcMOmLM1UgLOR1ANJJG0Ugw7C0lYh-fVBuGOxhelkztLVgGzwmMXiMCxbi-aG4zBtQR_idkDLyA9vDMZ6FpTjAgaIgYiNcIwzrt3vMnuPHqbO57MgiJYdYbwsIh6_UpsAPeMPzMgpsOnvwUYbgDUpoxQLpfs5kbuw1tjuupaovg1wUDGe1yfBxgjXrCDPgyZIvZnFeYopFCdbvC9pXtqk4X2O-bY3s4SLlvi7mvtep0rWwrW2OrsamroZNV19adMbrumoJ6JVUlG6X2lZL7djfiEWXTtVhZpYfaiIPERZPbObctOw5T8TS5b6pDLQunB3TxuSNKeby9EhBK5ZUJfT5TDusUxUE6iin-x5IouedyGaf9VCayd1Gf4O_s8Egeyylo8miBr6_wR_6Z28UaXD-ndI2i-hDqItTlta07w4tQl6zg_Sqvgf9Bk4S6_PpzLs-5_g0AAP__WfZH6Q">