[clang-tools-extra] [clang-tidy] Handle auto&& in missing-std-forward (PR #220164)
Zeyi Xu via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 1 00:05:08 PDT 2026
================
@@ -0,0 +1,24 @@
+// RUN: %check_clang_tidy -std=c++20-or-later %s cppcoreguidelines-missing-std-forward %t -- -- -fno-delayed-template-parsing
+
+#include <utility>
+
+void does_not_forward_auto(auto &&t) {
+ // CHECK-MESSAGES: :[[@LINE-1]]:35: warning: forwarding reference parameter 't' is never forwarded inside the function body [cppcoreguidelines-missing-std-forward]
----------------
zeyi2 wrote:
Nit:
```suggestion
// CHECK-MESSAGES: :[[@LINE-1]]:35: warning: forwarding reference parameter 't' is never forwarded inside the function body
```
Same as below
https://github.com/llvm/llvm-project/pull/220164
More information about the cfe-commits
mailing list