summaryrefslogtreecommitdiff
path: root/shared/cplusplus/AST.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shared/cplusplus/AST.cpp')
-rw-r--r--shared/cplusplus/AST.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp
index f75fcf12a4..90cd140ef8 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)