[clang] [clang] Allow C-style casts in constexpr in MS compatible mode (PR #197005)
via cfe-commits
cfe-commits at lists.llvm.org
Mon May 18 04:51:10 PDT 2026
================
@@ -15584,3 +15581,31 @@ void ASTContext::recordOffsetOfEvaluation(const OffsetOfExpr *E) {
if (FieldDecl *FD = Comp.getField(); isPFPField(FD))
PFPFieldsWithEvaluatedOffset.insert(FD);
}
+
+bool ASTContext::maybeFoldMSConstexpr(
+ SmallVectorImpl<PartialDiagnosticAt> &Notes) {
+ if (Notes.size() != 1 || !getLangOpts().MSVCCompat)
+ return false;
+ auto &PD = Notes[0].second;
+ if (PD.getDiagID() != diag::note_constexpr_invalid_cast)
+ return false;
+ unsigned CastID;
+ switch (PD.getValueArg(0)) {
----------------
eleviant wrote:
Done.
https://github.com/llvm/llvm-project/pull/197005
More information about the cfe-commits
mailing list