summaryrefslogtreecommitdiff
path: root/shared/cplusplus/AST.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <qtc-committer@nokia.com>2009-01-06 11:59:28 +0100
committerRoberto Raggi <qtc-committer@nokia.com>2009-01-06 12:15:51 +0100
commit0f3372118aa95acc2440ea2a44fb08a267091db1 (patch)
tree532833e701da150af31bc114e559a819ae9ac84b /shared/cplusplus/AST.cpp
parent43db13a21fa35bd7e64503c1c1f6e7ca75c100e0 (diff)
downloadqt-creator-0f3372118aa95acc2440ea2a44fb08a267091db1.tar.gz
TemplateTypeParameterAST::lastToken().
Diffstat (limited to 'shared/cplusplus/AST.cpp')
-rw-r--r--shared/cplusplus/AST.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp
index 5921c4ae44..4ab7cdc424 100644
--- a/shared/cplusplus/AST.cpp
+++ b/shared/cplusplus/AST.cpp
@@ -2464,7 +2464,6 @@ unsigned TemplateTypeParameterAST::firstToken() const
unsigned TemplateTypeParameterAST::lastToken() const
{
- assert(0 && "review me");
if (type_id)
return type_id->lastToken();
else if (equal_token)
@@ -2473,7 +2472,18 @@ unsigned TemplateTypeParameterAST::lastToken() const
return name->lastToken();
else if (class_token)
return class_token + 1;
- return greater_token + 1;
+ else if (greater_token)
+ return greater_token + 1;
+
+ for (DeclarationAST *it = template_parameters; it; it = it->next) {
+ if (! it->next)
+ return it->lastToken();
+ }
+
+ if (less_token)
+ return less_token + 1;
+
+ return template_token + 1;
}
void ThisExpressionAST::accept0(ASTVisitor *visitor)