[PATCH] D77571: Add ClangTidy check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.

Ben Hamilton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 6 12:31:05 PDT 2020


benhamilton accepted this revision.
benhamilton added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clang-tidy/objc/NsinvocationArgumentLifetimeCheck.cpp:71-73
+  // Currently there is no way to directly get the source range for the
+  // __weak/__strong ObjC lifetime qualifiers, so it's necessary to string
+  // search in the source code.
----------------
Is there a bug filed for this? Seems like an oversight.



================
Comment at: clang-tools-extra/clang-tidy/objc/NsinvocationArgumentLifetimeCheck.cpp:116
+  auto Diag = diag(MatchedExpr->getArg(0)->getBeginLoc(),
+                   "NSInvocation's %0 should only pass pointers to "
+                   "objects with ownership __unsafe_unretained")
----------------
-[NSInvocation %0] should



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77571





More information about the cfe-commits mailing list