diff options
author | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-02 16:47:35 +0100 |
---|---|---|
committer | Roberto Raggi <qtc-committer@nokia.com> | 2009-01-02 16:47:35 +0100 |
commit | e89ec6c3fa287846df987ced8ae2b2d6e60944c0 (patch) | |
tree | 0eb428ce3413240a2a2edc16230008df44ee8007 /shared/cplusplus/AST.cpp | |
parent | bdf1800d83eef2c3940ed93466d3387fe2e172ee (diff) | |
download | qt-creator-e89ec6c3fa287846df987ced8ae2b2d6e60944c0.tar.gz |
Fixed SimpleDeclarationAST::firstToken().
Diffstat (limited to 'shared/cplusplus/AST.cpp')
-rw-r--r-- | shared/cplusplus/AST.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp index 7774d4d71f..c495ea1881 100644 --- a/shared/cplusplus/AST.cpp +++ b/shared/cplusplus/AST.cpp @@ -1940,15 +1940,12 @@ void SimpleDeclarationAST::accept0(ASTVisitor *visitor) unsigned SimpleDeclarationAST::firstToken() const { - for (SpecifierAST *it = decl_specifier_seq; it; it = it->next) { - if (! it->next) - return it->firstToken(); - } - for (DeclaratorListAST *it = declarators; it; it = it->next) { - if (! it->next) - return it->firstToken(); - } - return semicolon_token; + if (decl_specifier_seq) + return decl_specifier_seq->firstToken(); + else if (declarators) + return declarators->firstToken(); + else + return semicolon_token; } unsigned SimpleDeclarationAST::lastToken() const |