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

    <tr>
        <th>Summary</th>
        <td>
            performance-noexcept-swap is missing a method signature check
        </td>
    </tr>

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

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

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

<pre>
    Clang-Tidy 17 will introduce a new check (see D148697) `performance-noexcept-swap`. I tried this check on our code and it has one correct hint and one false positive:

```cpp
void MyClass::swap() // Warning here: "swap functions should be marked noexcept"
{
        m_swapped = !m_swapped;
}
```

It is correct that this method could be `noexcept`, but we have disabled `modernize-use-noexcept`, so my expectation would be, that here no warning is generated - and only in case of real swap methods the warning will be triggered.

Basically I would except, that the check tests the method signature whether it's matches sth. like `void swap( T& a, T& b )` (so has two parameter of same type like the [std::swap](https://en.cppreference.com/w/cpp/algorithm/swap) expects)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0lM-O4ygQxp8GX0qJCI7_HXyY7ihSH_a0I-1xRaBs2MZgQbk92adf4Tg9vbsaKYqtAqq--upnZEp29Ig9q15YdSnkQibE_vfFvzip3otb0Pf-1Uk_Hr5bfYdTA6t1DqynGPSiECR4XEEZVO_ARJsQ4XI6t3XXMNEBq_mMcQhxkl7hwQf8oXCmQ1rlzGp-hDegaFEDGZv2LMFDWCKooBGk12AJjEwQPIIKMaIiMNbTtpaDg3QJYQ7Jkv1AVn5j_ML487_mj5-a50fkI1gNv91fnUwpby6_bWJEu-kVVyau8IeM3voRDMacEJgQeRMMi1dkg0-QTFichhvCJOM7ani2xoTYKzcvTyHd9Gc-PqMGVl6AidNngJXPXc3lP4q_tvFGkP3Z2ycj6eHYhGSCBvUUw2r-KaTmTLzCbSFYEYz8QNA2yZvLKmo-BY3R27_xsKSfg9kPpQDTHfDHjIpkbhjWvUJe3cpna8AHWHerbIIRPUZJqOGwD8fdwXpQMiGEASJKB5uPD9kJyOBngo2rG2YexhEj6uNXA15ksko6d4e3XcvT7tenHbjzQ5jokXp3JyMuaYkIq0EyGMESE02CSZIymCCROYKz75t_Gx87EvCdiRpkLrK93YCJjtV8Iz1sWNIaYJZRTkgYc5dJTgh0n_GRMetg1Usi_QW26sJEa4jmjcCNOfRHNc8RB4zoFR5VmJi4rkxcM7niKt0YoiWTow913T6gxERX6L7UXdnJAvtT3fG2LdumLEwvqvLc4qke6qY-V7zumqo8lzgM55qrQfLC9oKLkrf8xLuqqcqjlloMTVuhVies2o6dOU7SuqNzH9MxxLGwKS3Y1-eSl4WTN3Rpuz6EUNtFQVbf81dQXYrY50OH2zImdubOJko_05Alh_0vr4dM1GRTymzI_49ym3WxRNf_28fRklluu3251v44zDH8hYqYuG76ExPXrYV_AgAA__-Tv6FV">