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

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy performance-move-const-arg does not work in template classes
        </td>
    </tr>

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

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

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

<pre>
    Runninng clang-tidy (trunk on godbolt.org) with 
`--checks=-*,performance-move-const-arg`
with following code correctly produces the warning https://godbolt.org/z/MWz4e1x8x
```
#include <utility>
//template <typename T = int>
struct Y {
    struct X {
        int i{0};
        X() = default;
        X(const X&) = default;
        X(X&&) = default;
    };
    void foo() {
 const X a;
        X b(::std::move(a));
    }
};
void test() {
    Y y;
    y.foo();
}
```
However, when the above line `//template <typename T = int>` is **not** commented out (i.e. Y becomes template), whilst compiling the code ok the warining **is not produced** any longer https://godbolt.org/z/srrv9Kjcn
```
#include <utility>
template <typename T = int>
struct Y {
    struct X {
 int i{0};
        X() = default;
        X(const X&) = default;
        X(X&&) = default;
    };
    void foo() {
 const X a;
        X b(::std::move(a));
    }
};
void test() {
    Y y;
    y.foo();
}
```
I am wondering if there is something I'm missing here? Perhaps I should be using different/additional command line options to clang-tidy or is this an issue/bug of sorts in clang-tidy?

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVU1v4zYQ_TX0ZWBDoizbOujgJBUaFAWKokA3R4ocWdxQHIMc2ev99QUlx5tk-7EoCvSygQLTo8d5M8P3TBWjPXjEWpR3onxYqJF7CrVD8ul_u120ZC71r6P31vsDaKf8YcnWXEDIHYfRPwN5OJBpyfGKwkHICs6WexDZg8j2YpMtl7pH_RxF8bAUci_k_RFDR2FQXuNyoBMuNfnISxUOYpPN-6YUHTlHZ5t4ySBoCgE1uwscA5lRYwTuEc4q-ITpmY9RFHsh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