[clang] [clang-tools-extra] [clang][bytecode] Don't evaluate bound member function expressions in new constant interpreter (PR #194851)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 03:17:42 PDT 2026


================
@@ -2640,6 +2640,14 @@ bool Compiler<Emitter>::VisitMemberExpr(const MemberExpr *E) {
   }
 
   if (!isa<FieldDecl>(Member)) {
+    // Bound member functions (non-static CXXMethodDecls) cannot be
+    // constant-evaluated. visitDeclRef would blindly push a FnPtr,
+    // but the caller expects a MemberPointer, causing a stack mismatch.
----------------
tbaederr wrote:

This is an explanation of a bug, not of why we shouldn't constant-evaluate this.

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


More information about the cfe-commits mailing list