================ @@ -3249,166 +3249,204 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD) { } } } - -static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E, - llvm::SmallVectorImpl<Expr *> &List, - llvm::SmallVectorImpl<QualType> &DestTypes) { - if (List.size() >= DestTypes.size()) { - List.push_back(E); - // This is odd, but it isn't technically a failure due to conversion, we - // handle mismatched counts of arguments differently. +namespace { +class InitListTransformer { + Sema &S; + ASTContext &Ctx; + QualType InitTy; + QualType *DstIt = nullptr; + Expr **ArgIt = nullptr; + bool Wrap; + + bool castInitializer(Expr *E) { + assert(DstIt && "This should always be something!"); + if (DstIt == DestTypes.end()) { + if (!Wrap) { + ArgExprs.push_back(E); + // This is odd, but it isn't technically a failure due to conversion, we + // handle mismatched counts of arguments differently. + return true; + } + DstIt = DestTypes.begin(); + } + InitializedEntity Entity = + InitializedEntity::InitializeParameter(Ctx, *DstIt, true); ---------------- llvm-beanz wrote:
Good catch. I'll add a comment, but this is an obj-c thing. I should have left this as `false`. https://github.com/llvm/llvm-project/pull/133508 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits