From f74ba9daef50a0b267056c8753819d59621fc000 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 11 Aug 2010 13:46:32 +0200 Subject: Introduced CPlusPlus::Template and process the template declarations. --- src/shared/cplusplus/CheckDeclaration.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/shared/cplusplus/CheckDeclaration.cpp') 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; } -- cgit v1.2.1