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

    <tr>
        <th>Summary</th>
        <td>
            Sema::checkPointerTypesForAssignment calls IsFunctionConversion with From/To reversed
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    At the end of `Sema::checkPointerTypesForAssignment`:
```
  if (!S.getLangOpts().CPlusPlus &&
      S.IsFunctionConversion(ltrans, rtrans, ltrans))
```

`ltrans` and `rtrans` are the left and right sides of the assignment, and are therefore the destination and source types, respectively.

But:
```
bool Sema::IsFunctionConversion(QualType FromType, QualType ToType,
                                QualType &ResultTy) {
```
Here the source is first and the destination is second.

Maybe this a bug that has gone unnoticed because `IsFunctionConversion` tends to work symmetrically? (speculating)

Or maybe there is a good reason for `checkPointerTypesForAssignment` to invert the parameters, but it's not commented or at all apparent by source inspection.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVO9upDYQfxrzZXQIzALLBz5sckKt1OquTV7AwCy4Z-yVZ5xo376yQ3fTKlHPMmDmj-c3vxlbEenFIvaifhD110wFXp3vZxcWctZRNrr52p8YeEVAO4M7g2iKJ9yUqE6iOk0rTj--O20Z_fP1gjQ4f0qbbmhZNEU0K76K4hTXbzP9AugzCHkUsnzKF-TflF2-XZiSqMsfv5tA8QEhmzh3pzie8l9pCHZi7eyjsy_oSTsr5NGwV5aEfAR_W_0j6-L8CMhNuFs2BSg7xyz9XeAxMWDwzEnr9bIykJ6RIiVRp-5Zy8dktHt5PLvdf0ZibVUEnizIBT8hcCQuwUa64MT6Bc01fw_vIfBnRI7OGbgX5BNq_gjKxPrA4N0WFzHcTfjsdtF7mj8fNz8hmz-RguHnq5AdiPbhQ4i_4J7_nq8mOGtPb1T-lxdNQDg5O_-LgN_VdYx7aAIFY1iAV8WwKoLFWYRgrWM94QwjTioQxvp9SEVTAKOdCdjBq_M_gK7bhuz1pIy5imqITRmrEIxibZd726T3Nw_bDiUmleAszs3gUZGzcHY-hv7fYxHD6wjq7WhdlFcbMvrUBmNg0CxkS2Adw-S26IUzOA-KQRkD6nJRHi3DeL2xat-ax9k8m_tq7qpOZdiXbVnUZXM8FNnaY4uya9pubo71Ec9NI2t5LKui6o61ats6070s5KGoyrqsq6ru8rZq2ka2VV2XpZJ1Iw4Fbkqb3JiXLXd-yTRRwP5YH8o6M2pEQ-k2kdLiKySlkDJeLr6PPl_GsJA4FEYT030X1myw_9mLBWK1CD6qMLxqXlObCzk8O_AYFThnwZt-Zb5QDCAHIYdF8xrGfEqmEcn--XLx7i-cWMgh4Schh5Tf3wEAAP__93ipUQ">