[cfe-commits] r103369 - /cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
Douglas Gregor
dgregor at apple.com
Sat May 8 18:26:06 PDT 2010
Author: dgregor
Date: Sat May 8 20:26:06 2010
New Revision: 103369
URL: http://llvm.org/viewvc/llvm-project?rev=103369&view=rev
Log:
Be more careful about picking a template parameter when we fail to substitute explicit template arguments into a function template
Modified:
cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=103369&r1=103368&r2=103369&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Sat May 8 20:26:06 2010
@@ -1189,8 +1189,10 @@
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;
}
More information about the cfe-commits
mailing list