[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

Don Hinton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 1 10:36:45 PDT 2019


hintonda marked an inline comment as done.
hintonda added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/llvm/AvoidCastInConditionalCheck.cpp:125-126
+
+    diag(MatchedDecl->getBeginLoc(), "return value from dyn_cast<> not used")
+        << FixItHint::CreateReplacement(SourceRange(StartLoc, EndLoc), "isa");
+  } else if (const auto *MatchedDecl =
----------------
aaron.ballman wrote:
> There are zero test cases that seem to trigger this diagnostic text.
Sorry for any confusion, but there are actually 3 tests for this below.  That'll be made clearer once I address your comments below, and spell out the entire diagnostic message on the first instance.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D59802





More information about the cfe-commits mailing list