[clang] [LifetimeSafety] Fix compiler crash with `static operator()` (PR #187853)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 23 08:45:34 PDT 2026


================
@@ -401,7 +402,12 @@ void FactsGenerator::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *OCE) {
     handleAssignment(OCE->getArg(0), OCE->getArg(1));
     return;
   }
-  VisitCallExpr(OCE);
+
+  ArrayRef Args = {OCE->getArgs(), OCE->getNumArgs()};
+  if (OCE->getOperator() == OO_Call && OCE->getDirectCallee()->isStatic()) {
+    Args = Args.slice(1);
+  }
----------------
usx95 wrote:

Also add a line describing why the reason for doing this.

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


More information about the cfe-commits mailing list