================ @@ -2419,8 +2419,13 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { return Visit(const_cast<Expr*>(E)); case CK_NoOp: { - return CE->changesVolatileQualification() ? EmitLoadOfLValue(CE) - : Visit(const_cast<Expr *>(E)); + if (CE->changesVolatileQualification()) + return EmitLoadOfLValue(CE); + auto V = Visit(const_cast<Expr *>(E)); + if (CGF.CGM.getCodeGenOpts().PointerAuth.CXXMemberFunctionPointers && + CE->getType()->isMemberFunctionPointerType()) + V = CGF.CGM.getCXXABI().EmitMemberPointerConversion(CGF, CE, V); + return V; ---------------- rjmccall wrote:
Why do we not need similar logic here when casting function pointer types when function pointer type diversity is enabled? Does Sema not use `CK_NoOp` for those? Maybe we should do the same for member pointer conversions and make sure there's a better cast kind to use. https://github.com/llvm/llvm-project/pull/109056 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits