aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-08-25 17:23:04 +0000
committerDouglas Gregor <dgregor@apple.com>2009-08-25 17:23:04 +0000
commit05396e20d68535612f58c84e0dfc7647c75a7da1 (patch)
tree6ebd628caace99d4ec89d58cc21cbcf6c30221e6 /lib/Sema/SemaDecl.cpp
parentc87efbd2cbd13e68ea771275f03d1bbd1b741e47 (diff)
Implement out-of-line definitions of nested class templates. Most of
the logic is there for out-of-line definitions with multiple levels of nested templates, but this is still a work-in-progress: we're having trouble determining when we should look into a dependent nested-name-specifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 99c1338fba..ee6238c56c 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2106,11 +2106,6 @@ Sema::ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC,
}
}
- // Check that we can declare a template here.
- if (TemplateParamLists.size() &&
- CheckTemplateDeclScope(S, TemplateParamLists))
- return 0;
-
// Match up the template parameter lists with the scope specifier, then
// determine whether we have a template or a template specialization.
if (TemplateParameterList *TemplateParams
@@ -2391,11 +2386,6 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
D.setInvalidType();
}
- // Check that we can declare a template here.
- if (TemplateParamLists.size() &&
- CheckTemplateDeclScope(S, TemplateParamLists))
- return 0;
-
bool isVirtualOkay = false;
FunctionDecl *NewFD;
if (isFriend) {
@@ -2515,6 +2505,11 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
TemplateParamLists.size())) {
if (TemplateParams->size() > 0) {
// This is a function template
+
+ // Check that we can declare a template here.
+ if (CheckTemplateDeclScope(S, TemplateParams))
+ return 0;
+
FunctionTemplate = FunctionTemplateDecl::Create(Context, CurContext,
NewFD->getLocation(),
Name, TemplateParams,
@@ -3960,8 +3955,9 @@ Sema::DeclPtrTy Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
OwnedDecl = false;
DeclResult Result = CheckClassTemplate(S, TagSpec, TUK, KWLoc,
SS, Name, NameLoc, Attr,
- move(TemplateParameterLists),
+ TemplateParams,
AS);
+ TemplateParameterLists.release();
return Result.get();
} else {
// FIXME: diagnose the extraneous 'template<>', once we recover