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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] false positive on bugprone-assignment-in-if-condition with a requires clause in if
        </td>
    </tr>

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

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

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

<pre>
    Tested on 902fb1b4653d5a23613492406cd5693446f06ab6

# Steps to reproduce:
test.cpp
```c++
int main() {
        if constexpr (requires (int &a) { a = 0; }) {}
}
```
```sh
clang-tidy --checks=bugprone-assignment-in-if-condition ./test.cpp -- -std=c++20
```

## result:
```
1 warning generated.
test.cpp:2:38: warning: an assignment within an 'if' condition is bug-prone [bugprone-assignment-in-if-condition]
    2 |         if constexpr (requires (int &a) { a = 3; }) {}
      | ~~^~~
test.cpp:2:38: note: if it should be an assignment, move it out of the 'if' condition
test.cpp:2:38: note: if it is meant to be an equality check, change '=' to '=='
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVN2SszYMfRpxoyHjyOHvgovNR_MC7QvYRoC3xM5is1_3Zp-944Rs2kzb2TIesI2k43MsSYVgR8fcQnGEosvUGie_tG_av75m2vcf7W8cIvfoHTaCBr3Xh7KQfaFIlnt5aOggStMXZSMPh3IQpdIliA7Ey_Ymib9GvgSMHhe-LL5fDYPcfkcOcWcul824FLdhgI5pXHeti3hW1gHVQA1CdbwDNHZA412I_MdlQaB64bfVLhzSPLkBlWrzQYUgOxQgjwhVd49UdVuwr8n9DE_LMN02zKzcmEfbf2Cem4nN7wFkp9fxsnjH-U3PM7uYW5fbITfe9TZa73AHdLrzxTzHPMQeZLdxpWfAJxWTkAuHdY5f4j2Z7vGnWpx1I47seFGR-92TyvKFQL7IGuTL3ThNlcPHufGnjZN1aROosgNQhQ8SNqBex_xKFqE4foM4FJu0iIiEUP3A-_P_70_-y_3d4qXYn59Q_PL5-R_MnY8pAxO6jRgmv849av67DEA_8OzfOZn4NaIfME78D5J8G8gGPLNyMVXCDY3fVjXb-IHXPEqIZlJuvKKA7BJM9PfFdf108Vnfyr6Rjcq43VckZF1TI7OprbUQvel1pWWllRJcl2ZodMlsTEmyzGxLgg6iEhXtZb2XO11XFZVDMxiqBBHBQfBZ2Xk3z-_nnV_GzIawcttUTUXZrDTP4do0iB4lAUSpiSxtcsr1OgY4iNmGGB5hoo3ztd38xa3ocFBzYLz4YKN959RuvlNTKVdR4VfemFmtgdE6tEO2LnM7xXgJqWLoBHQabZxWvTP-DHRKJ9o-KZ9f2USg05VlADrdiL639GcAAAD__85chb8">