diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-06-25 17:21:05 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-06-25 17:21:05 +0000 |
commit | 6b02009359a462ffe633696a4441313b462e6566 (patch) | |
tree | bdbb007cf684bb40e1501ce34a808e7e9742b013 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 5c62ef52ac555bc2e2c9a3d26b2aa9b0598451f7 (diff) |
Make explicit specializations at class scope work
for non-type template parameters in microsoft mode.
PR12709.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159147 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index d4b5ffe517..bbf8f50a3c 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1952,13 +1952,22 @@ Decl * TemplateDeclInstantiator Decl *TemplateDeclInstantiator::VisitClassScopeFunctionSpecializationDecl( ClassScopeFunctionSpecializationDecl *Decl) { CXXMethodDecl *OldFD = Decl->getSpecialization(); - CXXMethodDecl *NewFD = cast<CXXMethodDecl>(VisitCXXMethodDecl(OldFD, 0, true)); + CXXMethodDecl *NewFD = cast<CXXMethodDecl>(VisitCXXMethodDecl(OldFD, + 0, true)); LookupResult Previous(SemaRef, NewFD->getNameInfo(), Sema::LookupOrdinaryName, Sema::ForRedeclaration); + TemplateArgumentListInfo TemplateArgs; + TemplateArgumentListInfo* TemplateArgsPtr = 0; + if (Decl->hasExplicitTemplateArgs()) { + TemplateArgs = Decl->templateArgs(); + TemplateArgsPtr = &TemplateArgs; + } + SemaRef.LookupQualifiedName(Previous, SemaRef.CurContext); - if (SemaRef.CheckFunctionTemplateSpecialization(NewFD, 0, Previous)) { + if (SemaRef.CheckFunctionTemplateSpecialization(NewFD, TemplateArgsPtr, + Previous)) { NewFD->setInvalidDecl(); return NewFD; } |