summaryrefslogtreecommitdiff
path: root/shared/cplusplus
diff options
context:
space:
mode:
authorRoberto Raggi <qtc-committer@nokia.com>2009-01-05 10:29:12 +0100
committerRoberto Raggi <qtc-committer@nokia.com>2009-01-05 10:29:12 +0100
commit4fcadbdd49879c43c77d25faab833422bb82dd3a (patch)
treea3150bb3a25135f9d20e89fc7eb1fa783fa6c37d /shared/cplusplus
parent77c16d13172cad7a801a30ab53953dee04418f01 (diff)
downloadqt-creator-4fcadbdd49879c43c77d25faab833422bb82dd3a.tar.gz
Implemented LinkageBodyAST::lastToken().
Diffstat (limited to 'shared/cplusplus')
-rw-r--r--shared/cplusplus/AST.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp
index f75fcf12a4..90cd140ef8 100644
--- a/shared/cplusplus/AST.cpp
+++ b/shared/cplusplus/AST.cpp
@@ -1606,8 +1606,15 @@ unsigned LinkageBodyAST::firstToken() const
unsigned LinkageBodyAST::lastToken() const
{
- assert(0 && "review me");
- return rbrace_token + 1;
+ if (rbrace_token)
+ return rbrace_token + 1;
+
+ for (DeclarationAST *it = declarations; it; it = it->next) {
+ if (! it->next)
+ return it->lastToken();
+ }
+
+ return lbrace_token + 1;
}
void LinkageSpecificationAST::accept0(ASTVisitor *visitor)