From b5a6ee19e26c063282aeb1bca4ccd8bb54913f2f Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Fri, 13 Aug 2010 12:04:28 +0200
Subject: [PATCH] Process template declarations.

---
 src/shared/cplusplus/Bind.cpp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp
index 4062c266cb4..c47878a4c8b 100644
--- a/src/shared/cplusplus/Bind.cpp
+++ b/src/shared/cplusplus/Bind.cpp
@@ -1862,15 +1862,23 @@ bool Bind::visit(ParameterDeclarationAST *ast)
 
 bool Bind::visit(TemplateDeclarationAST *ast)
 {
-    // unsigned export_token = ast->export_token;
-    // unsigned template_token = ast->template_token;
-    // unsigned less_token = ast->less_token;
+    Template *templ = control()->newTemplate(ast->firstToken(), 0);
+    ast->symbol = templ;
+    Scope *previousScope = switchScope(templ);
+
     for (DeclarationListAST *it = ast->template_parameter_list; it; it = it->next) {
         this->declaration(it->value);
     }
     // unsigned greater_token = ast->greater_token;
     this->declaration(ast->declaration);
-    // Template *symbol = ast->symbol;
+    (void) switchScope(previousScope);
+
+    if (Symbol *decl = templ->declaration()) {
+        templ->setSourceLocation(decl->sourceLocation(), translationUnit());
+        templ->setName(decl->name());
+    }
+
+    _scope->addMember(templ);
     return false;
 }
 
-- 
GitLab