================
@@ -642,6 +726,41 @@ void MoveChecker::checkPreCall(const CallEvent &Call,
CheckerContext &C) const {
// class in which the encountered method defined.
ThisRegion = ThisRegion->getMostDerivedObjectRegion();
+ // Store class declaration as well, for bug reporting purposes.
+ const CXXRecordDecl *RD = MethodDecl->getParent();
+
+ if (MethodDecl->getOverloadedOperator() == OO_Star ||
+ MethodDecl->getOverloadedOperator() == OO_Arrow) {
+ SVal Val = IC->getCXXThisVal();
+
+ if (const auto *POS = getIteratorPosition(State, Val)) {
+ const MemRegion *ContainerRegion = POS->getContainer();
+ if (!ContainerRegion)
+ return;
+
+ const auto *TypedRegion =
+ dyn_cast_if_present<TypedValueRegion>(ContainerRegion);
----------------
Xazax-hun wrote:
Or alternatively, the null check can be deleted above.
https://github.com/llvm/llvm-project/pull/196602
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits