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/SemaDecl.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/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 1b0a0abdb2..40643896fd 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -5066,7 +5066,11 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, FunctionTemplateDecl *FunctionTemplate = 0; bool isExplicitSpecialization = false; bool isFunctionTemplateSpecialization = false; + bool isDependentClassScopeExplicitSpecialization = false; + bool HasExplicitTemplateArgs = false; + TemplateArgumentListInfo TemplateArgs; + bool isVirtualOkay = false; FunctionDecl *NewFD = CreateNewFunctionDecl(*this, D, DC, R, TInfo, SC, @@ -5509,8 +5513,6 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, } else { // If the declarator is a template-id, translate the parser's template // argument list into our AST format. - bool HasExplicitTemplateArgs = false; - TemplateArgumentListInfo TemplateArgs; if (D.getName().getKind() == UnqualifiedId::IK_TemplateId) { TemplateIdAnnotation *TemplateId = D.getName().TemplateId; TemplateArgs.setLAngleLoc(TemplateId->LAngleLoc); @@ -5814,8 +5816,9 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, if (isDependentClassScopeExplicitSpecialization) { ClassScopeFunctionSpecializationDecl *NewSpec = ClassScopeFunctionSpecializationDecl::Create( - Context, CurContext, SourceLocation(), - cast<CXXMethodDecl>(NewFD)); + Context, CurContext, SourceLocation(), + cast<CXXMethodDecl>(NewFD), + HasExplicitTemplateArgs, TemplateArgs); CurContext->addDecl(NewSpec); AddToScope = false; } |