<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/97878>97878</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Confusing mismatch in diagnostics related to explicit this parameters
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nofe1248
</td>
</tr>
</table>
<pre>
Clang version: x86_64 trunk
Command line options: -std=c++26
Minimal reproduction:
```cpp
class TestClass {
void testFunction(this auto&& self, int &&some_rvalue_reference) {}
};
void testDiagnostics(int &&some_rvalue_reference) {
TestClass test_class;
test_class.testFunction(some_rvalue_reference); //error, should use std::move
}
```
[On Compiler Explorer](https://godbolt.org/z/a43jjqaW3)
Compiler Output:
```
...
<source>:2:10: note: candidate function template not viable: expects an rvalue for 1st argument
2 | void testFunction(this auto&& self, int &&some_rvalue_reference) {}
| ^ ~~~~~~~~~~~~~~~~
...
```
The underlined parameter should be `int &&some_rvalue_reference`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VEuP5CYQ_jXlS2ksN_g1Bx_6MX2L9rJSjiMM1W0mGBwenUkO-e0Rdmd6d6IouSyyjCnKX9X3VYEIQV8t0QDNAZpTIVKcnB-su9CO1X0xOvX7cDTCXvFGPmhnge_xvW9f2xqjT_YXqE5Q7Y9unoVVaLQldEvUzobs-RSiAn6SwA7ADqzdvH_SVs_CoKfFO5Vk3HC3TWir7ZHLslmkESHgVwrxuH5Bd9g2EBFvTiuMFOI52Q2I9XHSAUWKDlgLrMVA5gLsiNpG3EzBzfTqb8IkevV0IU9WErDnFbs73TPpTsDvobb3R7CTFlfrQtQyAOv_J-6W84NHBnpdyX2EyYwe5vITr39DB35AYGdgZ_Le-Uw1TC4ZhSkQriXYA9_P7kYPZt-LfV82hy8Wj25etCGPL--LcZ48NCdg_RTjkou6Rbo6NToTS-evwM5_ADuLmr-9_Sp-5jmjb0T7gPuS4pLiPwu9LcuyvNv5MbjkJQF_Ab5nwPe7KjeTdZHyLIVVWolIeLlrg5HmxWSLdRFvWoxm9aT3hWQMKCxusuHFedyFiMJf00w2PmRnCN0Rf3BLrfhrIGhe8Jvx56fxWZPvtfo6ESaryOfzpnARXswUyf9d9pEQ2uq_cmurslADV8_8WRQ07DpWsbrndVNMAxe7XvGuaupqrFXTyJGo5nRRMk91X-ghe1dd1VZt3dRNSW3dSMnanitRXZoe6opmoU1pzG3ObVLoEBINz13f9YURI5mwXjuMWfoN101gLN9Cfsj_PI3pGqCujA4xPFCijoaGo7OXFLS94qzDLKKcUFtUj2OJnnJDKIwut4HRUkdcq_ihViiSN8OnttZxSmMp3QzsnGPep6fFuzeSEdh5zTQAO29MbgP7KwAA__-QcaRP">