<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/162899>162899</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] `readability-redundant-parentheses` conflicts with suggested `-Wunreachable-code` mitigation
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          firewave
      </td>
    </tr>
</table>

<pre>
    ```cpp
void f(bool b)
{
    if (false && b) {}
}
```

The code above will report the following:
```
<source>:3:18: warning: code will never be executed [-Wunreachable-code]
    3 |     if (false && b) {}
      | ^
<source>:3:9: note: silence by adding parentheses to mark code as explicitly dead
    3 |     if (false && b) {}
      |         ^
      | /* DISABLES CODE */ ( )
```

But addressing that as suggested will lead to a clang-tidy warning:
```
<source>:3:9: warning: redundant parentheses around expression [readability-redundant-parentheses]
    3 | if ((false) && b) {}
      |         ^ ~
```

https://godbolt.org/z/nTvEGrr7c
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyklEGP2zYQhX_N6DLwgqJWtHXQQV5bRYECPSRAz6Q4ltjSpEFSdtxDf3tB2ds4boAsEMMQdZgZvfc9aWSMZnRELdRbqHeFnNPkQ3swgS7yTIXy-tqCYLf_cDoB687eaDwA3yjvLSrgDbAO1ltgHSKiOSDwzUHaSAhcABdLDeaK9W4pXa7vQ_M96z5PhIPXhFL5M-HFWIuBTj4kTBPhwVvrL8aNUHXPzdVb9HMYCKo9VF0FVVduoOrwIoO7ddwmLzMdnSmgIqQvNMyJNEK9Xf0xu0BymKSytMrFUO_udiqE9Rt-yNhStZRDvf--siarcT5RPqOx5AZCdUWptXEjnmQglyaKFDF5PMrw151KRPpysmYwyV5Rk9Q_I-_9d5P5IJv3wDvc_fqp2_62_4Rvv-_2CLwD3ufZeI_62-S2c8ryA8WYLaRJpiw3zuNIMQNeuFuSOluSOFjpxlUy-vqQ0I8zbZ4iDaRnp6VL30CTwc9OZ1aLHu9yvIGklspYk66r_9pWD23Pad9QvtNcIH4YKP7zf0RTSqeYXWa-_ei18ja9-DAC7_8G3rvP5_0vIayHQreVbqpGFtSWa8HKsuFcFFPblFWpmjUX9aaW1Wsl1LpuBlkzxYTc8KEwLWe8LlnJyg1jXLyUVPG1oFKVB86ZUPDK6CiNfbH2fMzPLkyMM7Wl4JumKaxUZOOyBjj_GhFwntdCaHPXSs1jhFdmTUzx65xkkl0WyENbvUMQ7MfgBcPBu4M1Q4p4MWl6eG9AsO98mILh0SQzymS8K-Zg2ye6Jk2zehn8EXifNd6P1Sn4P2lIwPvFeATe372fW_5vAAAA__8RwnpL">