================ @@ -11298,8 +11298,14 @@ static void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand, Expr *FromExpr = Conv.Bad.FromExpr; QualType FromTy = Conv.Bad.getFromType(); QualType ToTy = Conv.Bad.getToType(); - SourceRange ToParamRange = - !isObjectArgument ? Fn->getParamDecl(I)->getSourceRange() : SourceRange(); + SourceRange ToParamRange; + if (!isObjectArgument) { + if (I < Fn->getNumParams()) + ToParamRange = Fn->getParamDecl(I)->getSourceRange(); + else + // parameter pack case. + ToParamRange = Fn->parameters().back()->getSourceRange(); ---------------- cor3ntin wrote:
Can we assert the parameter is of a pack? Should we put that in a function in FunctionDecl? What about ``` void f(auto..., int a = 0) void f(auto..., auto...); ``` (we probably want to find the first pack) https://github.com/llvm/llvm-project/pull/92721 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits