summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/CheckDeclaration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/cplusplus/CheckDeclaration.cpp')
-rw-r--r--src/shared/cplusplus/CheckDeclaration.cpp22
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;
}