diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-03-23 12:04:44 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-03-23 14:15:45 +0100 |
commit | 9efa5d940acd0d000cc76515d5dbafa519c3d33f (patch) | |
tree | 4a78bba8dd1b74998f929af44fb3415089fef6eb /src/shared/cplusplus/CheckSpecifier.cpp | |
parent | f45ff92c28817558509aaca6a5e2f56bcb14bbef (diff) | |
download | qt-creator-9efa5d940acd0d000cc76515d5dbafa519c3d33f.tar.gz |
Added __attribute__ visiting, and storing of the deprecated attr.
Diffstat (limited to 'src/shared/cplusplus/CheckSpecifier.cpp')
-rw-r--r-- | src/shared/cplusplus/CheckSpecifier.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/shared/cplusplus/CheckSpecifier.cpp b/src/shared/cplusplus/CheckSpecifier.cpp index 70cdcacd5a..2d1d2e404a 100644 --- a/src/shared/cplusplus/CheckSpecifier.cpp +++ b/src/shared/cplusplus/CheckSpecifier.cpp @@ -69,9 +69,11 @@ CheckSpecifier::CheckSpecifier(Semantic *semantic) CheckSpecifier::~CheckSpecifier() { } -FullySpecifiedType CheckSpecifier::check(SpecifierListAST *specifier, Scope *scope) +FullySpecifiedType CheckSpecifier::check(SpecifierListAST *specifier, + Scope *scope, + const FullySpecifiedType &ty) { - FullySpecifiedType previousType = switchFullySpecifiedType(FullySpecifiedType()); + FullySpecifiedType previousType = switchFullySpecifiedType(ty); Scope *previousScope = switchScope(scope); SpecifierListAST *previousSpecifier = switchSpecifier(specifier); accept(specifier); @@ -80,9 +82,11 @@ FullySpecifiedType CheckSpecifier::check(SpecifierListAST *specifier, Scope *sco return switchFullySpecifiedType(previousType); } -FullySpecifiedType CheckSpecifier::check(ObjCTypeNameAST *typeName, Scope *scope) +FullySpecifiedType CheckSpecifier::check(ObjCTypeNameAST *typeName, + Scope *scope, + const FullySpecifiedType &ty) { - FullySpecifiedType previousType = switchFullySpecifiedType(FullySpecifiedType()); + FullySpecifiedType previousType = switchFullySpecifiedType(ty); Scope *previousScope = switchScope(scope); accept(typeName); @@ -327,6 +331,9 @@ bool CheckSpecifier::visit(ClassSpecifierAST *ast) klass->setVisibility(semantic()->currentVisibility()); _scope->enterSymbol(klass); _fullySpecifiedType.setType(klass); + accept(ast->attribute_list); + if (_fullySpecifiedType.isDeprecated()) + klass->setDeprecated(true); for (BaseSpecifierListAST *it = ast->base_clause_list; it; it = it->next) { BaseSpecifierAST *base = it->value; @@ -377,6 +384,7 @@ bool CheckSpecifier::visit(ElaboratedTypeSpecifierAST *ast) { const Name *name = semantic()->check(ast->name, _scope); _fullySpecifiedType.setType(control()->namedType(name)); + accept(ast->attribute_list); return false; } @@ -414,7 +422,11 @@ bool CheckSpecifier::visit(TypeofSpecifierAST *ast) return false; } -bool CheckSpecifier::visit(AttributeSpecifierAST * /*ast*/) +bool CheckSpecifier::visit(AttributeAST *ast) { + if (ast->identifier_token) { + if (identifier(ast->identifier_token) == control()->deprecatedId()) + _fullySpecifiedType.setDeprecated(true); + } return false; } |