From 1a7a8102d560dad5ed3ee098364047f9bfb1acfd Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Tue, 6 Jan 2009 12:05:30 +0100 Subject: [PATCH] TypenameCallExpressionAST::lastToken(). --- shared/cplusplus/AST.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp index 215a754441e..e357fc249cf 100644 --- a/shared/cplusplus/AST.cpp +++ b/shared/cplusplus/AST.cpp @@ -2676,8 +2676,20 @@ unsigned TypenameCallExpressionAST::firstToken() const unsigned TypenameCallExpressionAST::lastToken() const { - assert(0 && "review me"); - return rparen_token + 1; + if (rparen_token) + return rparen_token + 1; + + for (ExpressionListAST *it = expression_list; it; it = it->next) { + if (! it->next) + return it->lastToken(); + } + + if (lparen_token) + return lparen_token + 1; + else if (name) + return name->lastToken(); + + return typename_token + 1; } void TypenameTypeParameterAST::accept0(ASTVisitor *visitor) -- GitLab