================
@@ -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;
----------------
ahatanak wrote:

Depending on the kind of casts in the source code, `CStyleCastExpr` or 
`CXXReinterpretCastExpr` (or possibly another cast kind) is used when casting 
to a completely different function pointer type.

But those are explicit casts. I'm not sure there's another cast operation other 
than `CK_NoOp` in `clang/AST/OperationKinds.def` that we can use for that 
purpose.

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

Reply via email to