================
@@ -11298,8 +11298,9 @@ 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 && I < Fn->getNumParams())
+    ToParamRange = Fn->getParamDecl(I)->getSourceRange();
----------------
kadircet wrote:
> Though I don't think solving this is complicated

sorry I guess I didn't convey full context in my previous message when I just 
said "it requires propagating extra information in the bad conversion about the 
parameter location".  `Fn` in this context is the template decl itself, hence 
the packs in the parameters are dependent. hence we can't simply ask how many 
expansions are there.

https://github.com/llvm/llvm-project/pull/93079
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to