[clang] [CIR] Handle static methods defensively in emitCXXMemberCallExpr (PR #237420)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 6 16:46:04 PST 2026


================
@@ -2842,9 +2842,14 @@ RValue CIRGenFunction::emitCXXMemberCallExpr(const CXXMemberCallExpr *ce,
   const auto *me = cast<MemberExpr>(callee);
   const auto *md = cast<CXXMethodDecl>(me->getMemberDecl());
 
+  // Although Sema normally represents static method calls as ordinary
+  // CallExpr nodes, retain defensive handling here for parity with classic
+  // Clang (CGExprCXX.cpp:200) in case a CXXMemberCallExpr node is encountered.
----------------
andykaylor wrote:

Linking to a line number in classic codegen will become stale extremely quickly. The comment should explain what we're doing without reference to classic codegen.

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


More information about the cfe-commits mailing list