[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:59:15 PST 2026


andykaylor wrote:

Sorry. I submitted my previous review before reading the earlier discussion here. I'm not a big fan of having unreachable code around "as a defensive fallback" since that necessarily means that we have untested code in place. I'd prefer to see either an llvm_unreachable(), an errorUnsupported diagnostic, or an assert. In this case, I'd lean towards removing the `if (md->isStatic())` with `assert(!md->isStatic() && "static member call is unexpected");` and a comment explaining why it's unexpected.

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


More information about the cfe-commits mailing list