diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-08 19:15:54 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-08 19:15:54 +0000 |
commit | f1a8445036a2d047c7165d4170e3058cdeaba6eb (patch) | |
tree | fb7e6495091f1c263821ff171b0c33028739a4dc /lib/Sema/SemaTemplateDeduction.cpp | |
parent | a95342c9d4209379c07ac8da553688eacf500f98 (diff) |
Improve overload-candidate diagnostic for a function template that
failed because the explicitly-specified template arguments did not
match its template parameters, e.g.,
test/SemaTemplate/overload-candidates.cpp:18:8: note: candidate
template
ignored: invalid explicitly-specified argument for template
parameter 'I'
void get(const T&);
^
test/SemaTemplate/overload-candidates.cpp:20:8: note: candidate
template
ignored: invalid explicitly-specified argument for 1st template
parameter
void get(const T&);
^
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103344 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateDeduction.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateDeduction.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp index 2bb97eba11..f716ccd6f7 100644 --- a/lib/Sema/SemaTemplateDeduction.cpp +++ b/lib/Sema/SemaTemplateDeduction.cpp @@ -1190,8 +1190,11 @@ Sema::SubstituteExplicitTemplateArguments( SourceLocation(), ExplicitTemplateArgs, true, - Builder) || Trap.hasErrorOccurred()) + Builder) || Trap.hasErrorOccurred()) { + Info.Param = makeTemplateParameter(TemplateParams->getParam( + Builder.structuredSize())); return TDK_InvalidExplicitArguments; + } // Form the template argument list from the explicitly-specified // template arguments. |