diff options
Diffstat (limited to 'shared/cplusplus/AST.cpp')
-rw-r--r-- | shared/cplusplus/AST.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp index d30e6c14a1..5921c4ae44 100644 --- a/shared/cplusplus/AST.cpp +++ b/shared/cplusplus/AST.cpp @@ -2437,8 +2437,18 @@ unsigned TemplateIdAST::firstToken() const unsigned TemplateIdAST::lastToken() const { - assert(0 && "review me"); - return greater_token + 1; + if (greater_token) + return greater_token + 1; + + for (TemplateArgumentListAST *it = template_arguments; it; it = it->next) { + if (! it->next && it->template_argument) + return it->template_argument->lastToken(); + } + + if (less_token) + return less_token + 1; + + return identifier_token + 1; } void TemplateTypeParameterAST::accept0(ASTVisitor *visitor) |