-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Closed
Copy link
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzergood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
Clang version: x86_64 trunk
Command line options: -std=c++26
Minimal reproduction:
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
}
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
.
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzergood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute