summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2010-08-13 12:04:28 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2010-08-13 12:04:28 +0200
commitb5a6ee19e26c063282aeb1bca4ccd8bb54913f2f (patch)
tree19059a66c75ea0d586eee3d8dcd9f0bf6c9393d9 /src/shared/cplusplus
parent16adcf3114f6a4b8956b8a31fb5dad7c8f0edd77 (diff)
downloadqt-creator-b5a6ee19e26c063282aeb1bca4ccd8bb54913f2f.tar.gz
Process template declarations.
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r--src/shared/cplusplus/Bind.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/shared/cplusplus/Bind.cpp b/src/shared/cplusplus/Bind.cpp
index 4062c266cb..c47878a4c8 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;
}