diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp index f75fcf12a41..90cd140ef8f 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)