[clang-tools-extra] [clang-tidy][performance-unnecessary-value-param] Avoid in coroutines (PR #140912)

Dmitry Polukhin via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 12 05:10:00 PDT 2025


================
@@ -73,6 +74,10 @@ void UnnecessaryValueParamCheck::registerMatchers(MatchFinder *Finder) {
 void UnnecessaryValueParamCheck::check(const MatchFinder::MatchResult &Result) {
   const auto *Param = Result.Nodes.getNodeAs<ParmVarDecl>("param");
   const auto *Function = Result.Nodes.getNodeAs<FunctionDecl>("functionDecl");
+  if (!IsAllowedInCoroutines) {
+    if (auto Body = Function->getBody(); Body && isa<CoroutineBodyStmt>(Body))
+      return;
+  }
----------------
dmpolukhin wrote:

Done

https://github.com/llvm/llvm-project/pull/140912


More information about the cfe-commits mailing list