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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] `readability implicit bool conversion` applies wrong fix in ternary operator 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    When running `readability-implicit-bool-conversion` on this code we get an invalid fix.

```
int main()
{
    bool bar = true ? 1 : false;

```
Suggested fix:
```
int main()
{
    bool bar = true ? 1 : 0 != 0;

```

godbolt: https://godbolt.org/
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0UsuK5DoM_RplI1I4dp6LLLoo8gN3cdd2oiQaXHawnequvx9SD4ZpBmY1YOSXDudIOjpGXhxRD9UZqkum97T60M9k-asuZWb8dO__X8lh2J1jtyDUIpCetGHL6Z7zdbM8csqN9zYfvbtRiOwd1AK9w7RyxNFPhJ-ECyXUDtndtOUJZ_46gbiA-HjFWrzW48ou4VWzA9mC7F4pzfl5QEQ8GNHogKAumMJOCGrAAkF94KxtJFDnN-yCf-T4b18WiokeYkD9AyECQRbHu_i7mmdc_GS8TQd4TWmLhyw5gBxeHycfFpBDNvVq6lSnM-qLuuuqWolWZWtflZ2Q1BjZzOVo9CSLojRKzt04qtk0bca9FFIVheikqAqpTqLTbd2Ws2gqI5VqoRR01WxP1t6uB13GMe7UN0VbN5nVhmx8Gyb0R1Ju9iVCKSzHFH_BEif7sNZotVvyxNMdqss3C-HbQs8-_m4hvW2WKeJn8G45hoTsMFFwOtzRbxR08gGzPdj-W7M4rbs5jf4KcjgEvbZ8C_4HjQnk8Cgqghwedf0MAAD__1Lq5gk">