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

    <tr>
        <th>Summary</th>
        <td>
            Clang-Tidy 19 incorrectly replaces std::expected with std::unexpected
        </td>
    </tr>

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

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

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

<pre>
    The following line in ResInsight is incorrectly updated by clang-tidy-19

`std::expected<caf::PdmObjectHandle, QString> result = method->execute();`
is changed to 
`std::unexpected<caf::PdmObjectHandle, QString> result = method->execute();`

Using `auto result = method->execute();` works correct without any issues.

https://github.com/OPM/ResInsight/blob/7899736f0501f742e45e6dd6022e75136251a6bd/GrpcInterface/RiaGrpcPdmObjectService.cpp#L556
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0kttq3DwUhZ9m-0bMoIMt2xe-mBz8_4GWpE36ALK0bSvVSEaSk8zbF09CQw-U3hQEgg17LWmtT6VkJ4_YQXUB1VWh1jyH2B3V5DE9FkMwp-5hRjIG58Kz9RNx1iOxnnzGdOOTneZMbCLW6xAj6uxOZF2MymjIcCLaKT_tsjWnHWuBHrYjacoGxAHEAV8W1BkNiEutxtfZnTneDo-o8__KG4fAL8mn-xytn0Bck4hpdZmAuCJHzHMwOxDX-IJ6zQi8Ad6CuABJgR5sInpWfkJDciA_Oa_-n3oDPXxJW1ogqVpz-Otd8hzi10TewiTPNs9hzUT5E7EprZj2r-pzzkvaHs174P1k87wOex2OwPvbu4_A-_d6gPeDCwPwvm7athZypBVlY11yLCuUxkjKOdYVE5JXTMnBAO__i4u-8RnjqDRuclZto-8B3WN8shr3elmAiw9VJQvTCdOKVhXYsbqsq7JhrSzmrmpQyJpJNEJz3hg51nVZN1Q1I8OxLgvbccorWrGGSiqY3KMehJCslXXDRs0YlBSPyrq9c0_HfYhTcc6iYyUtRVs4NaBLZ4I5fycOON-Ijt22tRvWKUFJnU05vetkmx12l-edB2tOhLU_oBxxcUpjIr8ge66G_IanYo2u-0M9m_fbtVti2MIE3r-WC7x_-9NTx78FAAD__3MvJUw">