From c1a2afceb5ef543138382817702feeca74e9cefb Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Tue, 6 Jan 2009 12:02:54 +0100 Subject: [PATCH] TypeIdAST::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 8cb625b4..67813b9e 100644 --- a/shared/cplusplus/AST.cpp +++ b/shared/cplusplus/AST.cpp @@ -2624,10 +2624,15 @@ unsigned TypeIdAST::firstToken() const unsigned TypeIdAST::lastToken() const { - assert(0 && "review me"); if (declarator) return declarator->lastToken(); - return type_specifier->lastToken(); + + for (SpecifierAST *it = type_specifier; it; it = it->next) { + if (! it->next) + return it->lastToken(); + } + + return 0; } void TypeidExpressionAST::accept0(ASTVisitor *visitor) -- 2.11.4.GIT