================
@@ -563,7 +563,8 @@ class InitListChecker {
// Reference just one if we're initializing a single scalar.
uint64_t ElsCount = 1;
// Otherwise try to fill whole array with embed data.
- if (Entity.getKind() == InitializedEntity::EK_ArrayElement) {
+ if (Entity.getKind() == InitializedEntity::EK_ArrayElement &&
+ Entity.getType()->isScalarType()) {
----------------
akash-manna-sky wrote:
Narrowed it to `isIntegerType() || isRealFloatingType()`, which matches the
integer/floating split in `ExprConstant` and `CGExprConstant`
(`isRealFloatingType` rather than `isFloatingType` since the latter includes
`_Complex`). Added a `_Complex` double case to both tests to cover the
per-element fallback.
https://github.com/llvm/llvm-project/pull/218262
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits