<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57819>57819</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy 15.0.0: readability-simplify-boolean-expr
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ThomasHuetsch
</td>
</tr>
</table>
<pre>
When applying clang-tidy with the ChainedConditionalAssignment option set to true it refactors the following code:
`bool foo(int& x)
{
if (x > 0)
return false;
else
{
x = 0;
}
return true;
}`
into
`bool foo(int& x)
{
return x <= 0;
}
`
The else branch is completely discarded.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVUk1z4yAM_TX4ookH44-EA4c02c7-gM7sGRvZZoeAB_A2_vcL3jRtj6sBW0Li6T2gd2oTv2a0IJfFbNpOMBhpp0PUaoN3HWeIM8JlltqiujirdNTOSnMOQU_2hjaCW_ISBIwQHUS_IugIHkc5ROfDDjA6Y9z7Du8UkvpM6JXQM-lo75xJaUfYSdtIWAd3wvgjfXz550AyPUKquQOpfwB9lsDDPMbVWxilCQn-yzbMC8_oG2K2jHdNeF-3kOP1M3gAZ1nPolzQ0Ye_fxN1B_-v6QGeSVy-83hyeDZ6S8eYxUDvpR1m0CGd5W0xGNFsoHQYpFeoygJF1XV1e-RV2xVK1IrXXBZRR4Piy-VWbUnL1PCcWEgle2103A5BJ0g9boesAaU94H3xxeqNmGNcQr459prGlJ7G2peJQQqM-fPxOyze_cYhiX7VIawYktMeTxUvZtGOdYfImmqkLbK-UsgVrRtWsxNWlDeFkX1SKEj7QtproQWjjFFe8TyrrmwqdVJVz5nix74dGtJQvEltyty4dH4qvNg59OsUUtLoEMNnUu5PFvEDX65xdl68ze4mw88VYxjmYictdsZ_AdY77Z4">