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

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 2 22:18:48 PDT 2026


================
@@ -15633,3 +15633,17 @@ void ASTContext::recordOffsetOfEvaluation(const OffsetOfExpr *E) {
   if (FieldDecl *FD = Comp.getField(); isPFPField(FD))
     PFPFieldsWithEvaluatedOffset.insert(FD);
 }
+
+bool ASTContext::maybeFoldConstexprWithCast(
+    SmallVectorImpl<PartialDiagnosticAt> &Notes) const {
+  if (Notes.size() != 1 || !getLangOpts().MSVCCompat)
----------------
shafik wrote:

I think I would prefer this split into two early exit w/ the `!getLangOpts().MSVCCompat` first.

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


More information about the cfe-commits mailing list