================
@@ -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->isRealFloatingType()) {
const FPOptions FPO =
Init->getFPFeaturesInEffect(Info.Ctx.getLangOpts());
APFloat FValue(0.0);
if (!HandleIntToFloatCast(Info, Init, FPO, EmbedS->getType(), Value,
DestTy, FValue))
return false;
Result.getArrayInitializedElt(ArrayIndex) = APValue(FValue);
+ } else {
+ return false;
----------------
efriedma-quic wrote:
Failing out here is probably not standard-compliant, but maybe better than
crashing.
We should consider changing the AST. InitListChecker::CheckArrayType has a
check `elementType->isScalarType()` which is probably too inclusive.
https://github.com/llvm/llvm-project/pull/182257
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits