[PATCH] D102294: [clang-tidy] bugprone-infinite-loop: React to ObjC ivars and messages in condition.

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 12 01:55:46 PDT 2021


vsavchenko added a comment.

Tests look thorough, it should only reduce the number of warnings and should only affect Obj-C. So, I'd say that it's safe and sound! Great job!



================
Comment at: clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp:64-66
+  } else if (isa<MemberExpr>(Cond) || isa<CallExpr>(Cond) ||
+             isa<ObjCIvarRefExpr>(Cond) || isa<ObjCPropertyRefExpr>(Cond) ||
+             isa<ObjCMessageExpr>(Cond)) {
----------------
Situations like this make me think that variadic `isa` is not such a bad idea 😅


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

https://reviews.llvm.org/D102294



More information about the cfe-commits mailing list