diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-12-14 03:18:05 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-12-14 03:18:05 +0000 |
commit | b300e5bbaa71a937629ab0f6034d434f75363bd6 (patch) | |
tree | ff4f672109fadb3808a0c139897a12f7700e3bbc /lib/Sema/SemaTemplate.cpp | |
parent | 849480d2048277be1219fbb2e2e4da4e0542af09 (diff) |
PR18246: When performing template argument deduction to decide which template
is specialized by an explicit specialization, start from the first declaration
in case we've got a member of a class template (redeclarations might not number
the template parameters the same way).
Our recover here is still far from ideal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197305 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index b134f6ea51..e4fa380c3d 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -6521,9 +6521,9 @@ bool Sema::CheckFunctionTemplateSpecialization( // FIXME: It is somewhat wasteful to build TemplateDeductionInfo Info(FailedCandidates.getLocation()); FunctionDecl *Specialization = 0; - if (TemplateDeductionResult TDK - = DeduceTemplateArguments(FunTmpl, ExplicitTemplateArgs, FT, - Specialization, Info)) { + if (TemplateDeductionResult TDK = DeduceTemplateArguments( + cast<FunctionTemplateDecl>(FunTmpl->getFirstDecl()), + ExplicitTemplateArgs, FT, Specialization, Info)) { // Template argument deduction failed; record why it failed, so // that we can provide nifty diagnostics. FailedCandidates.addCandidate() |