summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus/AST.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-06-18 17:48:55 +0200
committerRoberto Raggi <roberto.raggi@nokia.com>2009-06-18 17:49:17 +0200
commit9c038180d81be6506554907998cab4cb1dd8b3c2 (patch)
tree82807dd4c03805045ce8c534f84218252db8961c /src/shared/cplusplus/AST.cpp
parentc3c98cca785d24c05e552ed5ed113a7b73341965 (diff)
downloadqt-creator-9c038180d81be6506554907998cab4cb1dd8b3c2.tar.gz
Improved compatibility with the gcc extensions.
Diffstat (limited to 'src/shared/cplusplus/AST.cpp')
-rw-r--r--src/shared/cplusplus/AST.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/shared/cplusplus/AST.cpp b/src/shared/cplusplus/AST.cpp
index 39c3795116..c809f6e1d0 100644
--- a/src/shared/cplusplus/AST.cpp
+++ b/src/shared/cplusplus/AST.cpp
@@ -570,6 +570,8 @@ unsigned DeclarationListAST::lastToken() const
unsigned DeclaratorAST::firstToken() const
{
+ if (attributes)
+ return attributes->firstToken();
if (ptr_operators)
return ptr_operators->firstToken();
else if (core_declarator)
@@ -589,7 +591,7 @@ unsigned DeclaratorAST::lastToken() const
if (initializer)
return initializer->lastToken();
- for (SpecifierAST *it = attributes; it; it = it->next) {
+ for (SpecifierAST *it = post_attributes; it; it = it->next) {
if (! it->next)
return it->lastToken();
}
@@ -607,6 +609,11 @@ unsigned DeclaratorAST::lastToken() const
return it->lastToken();
}
+ for (SpecifierAST *it = attributes; it; it = it->next) {
+ if (! it->next)
+ return it->lastToken();
+ }
+
// ### assert?
return 0;
}