================
@@ -5955,8 +5960,7 @@ TryListConversion(Sema &S, InitListExpr *From, QualType
ToType,
Result.Standard.setAsIdentityConversion();
Result.Standard.setFromType(InitTy);
Result.Standard.setAllToTypes(InitTy);
- for (unsigned i = 0; i < e; ++i) {
- Expr *Init = From->getInit(i);
+ for (Expr *Init : From->inits()) {
----------------
akash-manna-sky wrote:
For the conversion sequence, yes: it depends only on type and value category,
and narrowing is not part of it (`f({25, 255})` with a single
`initializer_list<signed char>` candidate resolves and then fails on
narrowing). The narrowing check that runs afterwards is where it mattered:
`DiagnoseNarrowingInInitList` evaluated a multi-element `EmbedExpr` as one
constant, its first byte, so `signed char x[] = { #embed ... }` never diagnosed
a later byte. That check and the C23 constexpr one now test every element.
https://github.com/llvm/llvm-project/pull/231938
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits