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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] performance-noexcept-move-constructor False Positive on =default'ed move SMFs
        </td>
    </tr>

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

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

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

<pre>
    performance-noexcept-move-constructor incorrectly warns about code employs https://eel.is/c++draft/except.spec#6 `noexcept(auto)` behaviour for `=default`ed special member functions (SMFs):

```
class Base {
protected:
     ~Base() = default; // want this
     // need these because of recent Clang -Wdeprecated:
 Base(const Base &) = default;
     Base(Base &&) = default;             // warning: move ctors should be noexcept
     Base &operator=(const Base &) = default;
     Base &operator=(Base &&) = default;
     Base() = default;

     ~~~
};
```

In our case (https://codereview.qt-project.org/c/qt/qtbase/+/616627/comment/e32ef87f_2d0bf46b/), these `=default`s are coming from a macro, so we actively rely on [expect.spec]/6.

Expected behaviour: Clang-tidy either excludes `=default`ed SMFs from the analysis or (harder) actively calculates the noexcept specification for defaulted SMFs and only warns if the result is `false`.

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVEGv4yYQ_jXkMkqEcezYBx-STS31UKlSDz1WGIaYCoMXcN5LD--3VxAn7-3uU9W1LEeBGb5v-L4ZHoK-WMSOVCdSnTd8iaPz3cS9mJb4z2Zw8tbN6JXzE7cCt9bhq8A5bid3xa1wNkS_iOg8aCuc9yiiucEL9zYAH9wSQTiJgNNs3C3AGOMcSHkkrCesRzQ7HQjrBWEnwk7ScxXTeobYhRkFYWUNpKYPXMIavkRHWEtqCgOO_Krd4kE5n8JIeZao-GIiqSlKSEdobmDCaUAParEiamcDENb88Vsf0jnlkdD81nR96VEYHgKceEAghxOhx9m7iCKivIdDet7SPmENYS2Q8gw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