diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-11 13:46:32 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-11 15:25:19 +0200 |
commit | f74ba9daef50a0b267056c8753819d59621fc000 (patch) | |
tree | b8400aa8bd8248b6b42552f79d56294ed04d8657 /src/shared/cplusplus/CheckDeclaration.cpp | |
parent | 6618a3cd679bf76f8325ca38b934545b0d8f4c60 (diff) | |
download | qt-creator-f74ba9daef50a0b267056c8753819d59621fc000.tar.gz |
Introduced CPlusPlus::Template and process the template declarations.
Diffstat (limited to 'src/shared/cplusplus/CheckDeclaration.cpp')
-rw-r--r-- | src/shared/cplusplus/CheckDeclaration.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/shared/cplusplus/CheckDeclaration.cpp b/src/shared/cplusplus/CheckDeclaration.cpp index 595d549a48..607fd75ef3 100644 --- a/src/shared/cplusplus/CheckDeclaration.cpp +++ b/src/shared/cplusplus/CheckDeclaration.cpp @@ -447,19 +447,23 @@ bool CheckDeclaration::visit(ParameterDeclarationAST *ast) bool CheckDeclaration::visit(TemplateDeclarationAST *ast) { -#warning robe process template arguments -#if 0 - Scope *scope = new Scope(_scope->owner()); + Template *templ = control()->newTemplate(ast->firstToken()); + ast->symbol = templ; for (DeclarationListAST *param = ast->template_parameter_list; param; param = param->next) { - semantic()->check(param->value, scope); + semantic()->check(param->value, templ); } - semantic()->check(ast->declaration, _scope, - new TemplateParameters(_templateParameters, scope)); -#else - semantic()->check(ast->declaration, _scope); -#endif + semantic()->check(ast->declaration, templ); + + if (Symbol *decl = templ->declaration()) { + // propagate the name + if (decl->sourceLocation()) + templ->setSourceLocation(decl->sourceLocation(), translationUnit()); + templ->setName(decl->name()); + } + + _scope->addMember(templ); return false; } |