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

via cfe-commits cfe-commits at lists.llvm.org
Thu May 14 03:56:04 PDT 2026


================
@@ -2587,8 +2587,10 @@ APValue *VarDecl::evaluateValueImpl(SmallVectorImpl<PartialDiagnosticAt> &Notes,
   if (IsConstantInitialization &&
       (Ctx.getLangOpts().CPlusPlus ||
        (isConstexpr() && Ctx.getLangOpts().C23)) &&
-      !Notes.empty())
-    Result = false;
+      !Notes.empty()) {
+    if (!Ctx.maybeFoldMSConstexpr(Notes))
----------------
eleviant wrote:

Yep, I couldn't imagine how this may happen

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


More information about the cfe-commits mailing list