Issue 97878
Summary Confusing mismatch in diagnostics related to explicit this parameters
Labels new issue
Assignees
Reporter nofe1248
    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`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to