[PATCH] D95877: [analyzer] Fix static_cast on pointer-to-member handling

Deep Majumder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 2 19:14:59 PST 2021


RedDocMD added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp:223
+      auto DelIt = find_first(BaseList.begin(), BaseList.end(), PathBase);
+      assert(DelIt != BaseList.end() && "PTM has insufficient base specifiers");
+      BaseList.erase(DelIt);
----------------
vsavchenko wrote:
> It's better to be more verbose in the assertions.
> Additionally, I'm not sure that it is clear what it is all about because pointer-to-members do not have base specifiers.
Well, the `PointerToMember` contains a `PointerToMemberData`, which has a list of `CXXBaseSpecifier`. Should I put something like: "PointerToMemberData has insufficient number of base specifiers"?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95877



More information about the cfe-commits mailing list