[clang] [analyzer] Assert isImplicitObjectMemberFunction in SValBuilder::getCXXThis (PR #220114)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 18 04:16:00 PDT 2026


================
@@ -44,6 +44,9 @@ void CXXSelfAssignmentChecker::checkBeginFunction(CheckerContext &C) const {
     return;
   if (!MD->isCopyAssignmentOperator() && !MD->isMoveAssignmentOperator())
     return;
+  if (!MD->isImplicitObjectMemberFunction())
+    return;
----------------
steakhal wrote:

This doesn't seem to be the right fix for this checker.
My impression would be that `CXXSelfAssignmentChecker` is outght to work regardless if the assignment has explicit or implicit obj param.

This also raises an important usability point: the checker devs who just want to model a binary operator (like assignment here), they want two svals: LHS and RHS.
What convenient ways can we offer to get them these that works regardless if the method has explicit or implicit obj param?

https://github.com/llvm/llvm-project/pull/220114


More information about the cfe-commits mailing list