[PATCH] D103750: [analyzer] Handle std::make_unique for SmartPtrModeling

Raphael Isemann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 11 05:00:10 PDT 2021


teemperor added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp:164
+  const auto *MethodDecl = dyn_cast_or_null<CXXMethodDecl>(Call.getDecl());
+  if (!MethodDecl || !MethodDecl->getParent())
+    return {};
----------------
`getParent()` will assert when the MethodDecl is not a in a Record (which is the only way this can return null) so you can remove that check.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103750



More information about the cfe-commits mailing list