<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61420>61420</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`cppcoreguidelines-rvalue-reference-param-not-moved` not reported for templated method
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
firewave
</td>
</tr>
</table>
<pre>
```cpp
#include <string>
class C
{
public:
template<typename T>
void str(T&& s) { // no warning
mStr = s;
}
void str2(std::string&& s) { // warning
mStr = s;
}
private:
std::string mStr;
};
void f()
{
C c;
c.str("");
c.str2("");
}
```
```
<source>:11:29: warning: rvalue reference parameter 's' is never moved from inside the function body [cppcoreguidelines-rvalue-reference-param-not-moved]
void str2(std::string&& s) {
``` ^
https://godbolt.org/z/zddq9hz34
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycU92S4iwQfZrOTZdWAvm9yIU_ny_wzQsQaJUtAlkgTs08_RbRVceamx0LCUXT55w-DSIEfbJEPVRbqPaZmOPZ-f6oPb2LC2WDUx891Pl1yGmCfA_5BhjXVppZEQLfhei1PQH_7xZcZmlECLi7bTXb62KaB6Ml8NshRMRI42REJOC7-DGRFSPh2x0snbg4rTBED6x9A1YDqzEA6xCaLQI7ADugdfguvE0y7mnpN_4fPQLfYwC-fYSg2T9rfSZhwNoQVZLIN7fKvuf8EeHk9WUp9on6hW7BuGenzPt6mRelR2AtsO7F3oS2Q_mFWq6v1gFjy-ge0SXEvo09HPrb_GcJr5t8F9zsJaW28U1RAN8krM3dI75BfxFmJvR0JE9WEk7Ci5EieQTWBGAN6oCWLuRxdBdSePRuRG2DVoTxTHicrYzaWUy3EqHaymmSztNp1oqMthRWV5LVnWS1kKysi6sFE6r9T1r-UjVC9eWun2OcQkpfLsbJqcGZuHb-BOzwmf5K_e7On7zMVM9VxzuRUV_UTdvysi55du5JNm3Z8aKVlRpEW9f5sZC1qvK840NbdZnuWc54zouSsaphfF0MfKg70QyslUU1CChzGoU2a2MuY-LOdAgz9XVRsjwzYiATllfOmKV3XIKp59U-833KWQ3zKUCZGx1ieKBEHQ3118f_r2bXOVoX0dPkfEwNdf7-3BWOFM9OZbM3_YuBOp7nYS3dCOyQhNw-q8m7XyQjsMMiPwA7LOX9CQAA__91gV9K">