From 7c6c439c69788f9b9e1a4b132a03f1b84e78ccbc Mon Sep 17 00:00:00 2001
From: Roberto Raggi <qtc-committer@nokia.com>
Date: Tue, 6 Jan 2009 12:09:08 +0100
Subject: [PATCH] UsingDirectiveAST::lastToken().

---
 shared/cplusplus/AST.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp
index e0f1582db6d..911af02e53c 100644
--- a/shared/cplusplus/AST.cpp
+++ b/shared/cplusplus/AST.cpp
@@ -2772,8 +2772,13 @@ unsigned UsingDirectiveAST::firstToken() const
 
 unsigned UsingDirectiveAST::lastToken() const
 {
-    assert(0 && "review me");
-    return semicolon_token + 1;
+    if (semicolon_token)
+        return semicolon_token + 1;
+    else if (name)
+        return name->lastToken();
+    else if (namespace_token)
+        return namespace_token + 1;
+    return using_token + 1;
 }
 
 void WhileStatementAST::accept0(ASTVisitor *visitor)
-- 
GitLab