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