[PATCH] D158665: [clang-tidy] Improve cppcoreguidelines-avoid-reference-coroutine-parameters check

Chris Cotter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 23 20:14:30 PDT 2023


ccotter accepted this revision.
ccotter added a comment.
This revision is now accepted and ready to land.

Thanks!



================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidReferenceCoroutineParametersCheck.cpp:20
+  Finder->addMatcher(
+      functionDecl(unless(parameterCountIs(0)), hasBody(coroutineBodyStmt()))
+          .bind("fnt"),
----------------
Can we do this by matching if any parameter is of reference type, rather than relying on the logic living in `check` (I wrote this originally, although perhaps this would be an improvement). Happy to take this up as a followup...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158665/new/

https://reviews.llvm.org/D158665



More information about the cfe-commits mailing list