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

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy: false positive from `hicpp-noexcept-move` for templated, defaulted move constructors
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    Given the following source code:
```cpp
#include <type_traits>

struct A {
    A(A&&) = default;
};

template <typename T1>
struct B {
    B(B&&) = default;
};

static_assert(std::is_nothrow_move_constructible<A>::value, "");
static_assert(std::is_nothrow_move_constructible<B<int>>::value, "");
```

Running `clang-tidy -checks=hicpp-noexcept-move`
We get the following output:
```
<source>:9:5: warning: move constructors should be marked noexcept [hicpp-noexcept-move]
    B(B&&) = default;
    ^
            noexcept 
1 warning generated.
```

Although the move constructor is automatically noexcept due to it being defaulted just like struct `A` and otherwise the static_assert would fail on line 13.

[godbolt link](https://godbolt.org/z/nnjrTPqhj)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVF2zmjAQ_TXwsqODIKgPPKDe26fOdNrO9NEJsEI0JDQf2ttf3w2i3q9p55ZJMCHrnrNnD5Sqfso_8RNKsC3CXgmhzlw2YJTTFUKlagySIoi2QVQEWXQZVd-PT-KEy0q4GiFINvapx53VjFsTJA9jxHA3VrvKQgHBYn15AnTR35c0s2GsKMMWatwzJ2yQjGHBYntfD3eLXS-YvQFK1iF8n90AR6j1S6g1Qa0_CmUss7zaMWNQW0pgbO21SApudlLZVqvzrlMn3FVKXmB5KUiuTeHZDJEnJhwG8QaCOB7G6obx39nXNLm0A8a_YW5Ne17ZVyel77LvpWCymVheP8GkarE6Uu-2LacWT6TCXxX2duJp3DL8QGjQvrKLcrZ39q1Txm2yufjpQpjIFSlNODPtafilh4BbpUobMK1yooYSoWP6iDVc6UCQrt8jmG4_1G8fFqQP9831uuMMR7MrTSpboibr1dO_SFsIS8SbdhDodVXADTBnVedbz4R4uoPVDsEq4JYq9mAjXar74IwFwY8Io7cJ0WMDkzWQUVCfucEB74Wn4DwIuGdcgJKUQSLMkulzsqRko-pSCQ8gj17CeNla2xvfyviRxng-Vbqh3W-aUh709y8_2wMpG9Z5Uq-SFQsttwLzu5t8U_dMELFeGW7pEwN7rTpP_n13kZs0XN_u2pv5LsEbd4ROi_wVUW5bV04r1dFGiNP1Z9JrdcCKXrFHboxDQ4s0i-IsbPOoXOKcMUzKapmUWTbPqrKMF7M9S-P5fl6FgpUoTE46kTYhz-MojqNsNo-WSRQl0zRazBfRiiIXK0xZGcwj7EjvqQf2koU6HziUrjF0KLix5n5IfeKNRLzmJ2u0SufF52_xLBzI5gPTP_IOvTk">