forked from OSchip/llvm-project
Be more careful about picking a template parameter when we fail to substitute explicit template arguments into a function template
llvm-svn: 103369
This commit is contained in:
parent
e0b5b3a1c5
commit
62c281a873
|
@ -1189,8 +1189,10 @@ Sema::SubstituteExplicitTemplateArguments(
|
|||
ExplicitTemplateArgs,
|
||||
true,
|
||||
Builder) || Trap.hasErrorOccurred()) {
|
||||
Info.Param = makeTemplateParameter(TemplateParams->getParam(
|
||||
Builder.structuredSize()));
|
||||
unsigned Index = Builder.structuredSize();
|
||||
if (Index >= TemplateParams->size())
|
||||
Index = TemplateParams->size() - 1;
|
||||
Info.Param = makeTemplateParameter(TemplateParams->getParam(Index));
|
||||
return TDK_InvalidExplicitArguments;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue