[PATCH] D66847: [analyzer] Fix analyzer warnings.

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 17:48:52 PDT 2019


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

> if the dyn_ part is really necessary here, then you crash with a null dereference a few lines below because you didn't check the result

Hmm, can we detect things like this?:

  if (isa<FunctionDecl>(D)) {
    const auto *FD = dyn_cast(D); // warn: D is known to be a FunctionDecl, prefer using cast<>
    // ...
  }


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

https://reviews.llvm.org/D66847





More information about the cfe-commits mailing list