[clang] [Clang] Fixed an assertion in constant evaluation of EmbedExpr inside array initializers. (PR #182257)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 19 04:46:40 PST 2026


================
@@ -14770,15 +14770,16 @@ bool ArrayExprEvaluator::VisitCXXParenListOrInitListExpr(
         Value = SL->getCodeUnit(I);
         if (DestTy->isIntegerType()) {
           Result.getArrayInitializedElt(ArrayIndex) = APValue(Value);
-        } else {
-          assert(DestTy->isFloatingType() && "unexpected type");
+        } else if (DestTy->isFloatingType()) {
----------------
tbaederr wrote:

This should be `isRealFloatingType()` now, to make sure we really have a builtin floating type in this branch.

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


More information about the cfe-commits mailing list