[PATCH] D82824: [clang-tidy] Added option to readability-else-after-return

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 30 08:39:48 PDT 2020


aaron.ballman added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp:193
   if (checkConditionVarUsageInElse(If) != nullptr) {
+    if (!WarnOnConditionVariables)
+      return;
----------------
Would it make sense to hoist this into the previous `if` statement so we don't bother checking the condition var use in the first place if we're just going to ignore the results?


================
Comment at: clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp:228
   if (checkInitDeclUsageInElse(If) != nullptr) {
+    if (!WarnOnConditionVariables)
+      return;
----------------
Same here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82824





More information about the cfe-commits mailing list