diff options
author | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-06 11:57:04 +0100 |
---|---|---|
committer | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-06 12:15:50 +0100 |
commit | 43db13a21fa35bd7e64503c1c1f6e7ca75c100e0 (patch) | |
tree | 64c44f19d029788bef021b54d0dc4845cb5c665b /shared/cplusplus/AST.cpp | |
parent | c187d71cb05a6f829e2fcecc3dbd57be58dc12a4 (diff) | |
download | qt-creator-43db13a21fa35bd7e64503c1c1f6e7ca75c100e0.tar.gz |
TemplateIdAST::lastToken().
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) |