[clang] [clang] Allow C-style casts in constexpr in MS compatible mode (PR #197005)

via cfe-commits cfe-commits at lists.llvm.org
Tue May 19 05:51:04 PDT 2026


================
@@ -19439,7 +19453,7 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) {
   case CK_PointerToIntegral: {
     CCEDiag(E, diag::note_constexpr_invalid_cast)
         << diag::ConstexprInvalidCastKind::ThisConversionOrReinterpret
-        << Info.Ctx.getLangOpts().CPlusPlus << E->getSourceRange();
+        << Info.Ctx.getLangOpts().CPlusPlus << true << E->getSourceRange();
----------------
eleviant wrote:

> getLValueBase

Ok, got it (I think). But can we just check for isLValue()? Updated the diff, PTAL

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


More information about the cfe-commits mailing list