diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-12-31 02:02:54 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-12-31 02:02:54 +0000 |
| commit | 9b534547250a37b0cdf9fd4ac1b10dc37d3cfe4a (patch) | |
| tree | bbb5e1d3b72fa8753c0f6a214a570b6a8cf12616 /clang/lib/Sema/SemaTemplateDeduction.cpp | |
| parent | 9c1b6aad77ae19cb730c41487cc971fde43865e1 (diff) | |
| download | bcm5719-llvm-9b534547250a37b0cdf9fd4ac1b10dc37d3cfe4a.tar.gz bcm5719-llvm-9b534547250a37b0cdf9fd4ac1b10dc37d3cfe4a.zip | |
Improve diagnostic for the case where a function template candidate is rejected
by overload resolution because deduction succeeds, but the substituted
parameter type for some parameter (with deduced type) doesn't exactly match the
corresponding adjusted argument type.
llvm-svn: 256657
Diffstat (limited to 'clang/lib/Sema/SemaTemplateDeduction.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaTemplateDeduction.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index 837e0de4038..cd54920b08c 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -2954,8 +2954,12 @@ Sema::FinishTemplateArgumentDeduction(FunctionTemplateDecl *FunctionTemplate, continue; QualType DeducedA = Specialization->getParamDecl(ParamIdx)->getType(); - if (CheckOriginalCallArgDeduction(*this, OriginalArg, DeducedA)) - return Sema::TDK_SubstitutionFailure; + if (CheckOriginalCallArgDeduction(*this, OriginalArg, DeducedA)) { + Info.FirstArg = TemplateArgument(DeducedA); + Info.SecondArg = TemplateArgument(OriginalArg.OriginalArgType); + Info.CallArgIndex = OriginalArg.ArgIdx; + return TDK_DeducedMismatch; + } } } |

