diff --git a/src/shared/cplusplus/CheckDeclaration.cpp b/src/shared/cplusplus/CheckDeclaration.cpp index ec8ddfcc4ca37b5bb98dc30d44d470be05e8bf9a..467e28c92dce68e0c87dac7dd587211a4f34f559 100644 --- a/src/shared/cplusplus/CheckDeclaration.cpp +++ b/src/shared/cplusplus/CheckDeclaration.cpp @@ -177,6 +177,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast) if (ty.isDeprecated()) symbol->setDeprecated(true); + if (ty.isUnavailable()) + symbol->setUnavailable(true); if (ty.isFriend()) symbol->setStorage(Symbol::Friend); @@ -213,6 +215,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast) fun->setVirtual(ty.isVirtual()); if (ty.isDeprecated()) fun->setDeprecated(true); + if (ty.isUnavailable()) + fun->setUnavailable(true); if (isQ_SIGNAL) fun->setMethodKey(Function::SignalMethod); else if (isQ_SLOT) @@ -232,6 +236,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast) symbol->setType(declTy); if (declTy.isDeprecated()) symbol->setDeprecated(true); + if (declTy.isUnavailable()) + symbol->setUnavailable(true); if (_templateParameters && it == ast->declarator_list) { symbol->setTemplateParameters(_templateParameters); @@ -257,6 +263,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast) if (ty.isDeprecated()) symbol->setDeprecated(true); + if (ty.isUnavailable()) + symbol->setUnavailable(true); if (it->value && it->value->initializer) { FullySpecifiedType initTy = semantic()->check(it->value->initializer, _scope); @@ -338,6 +346,8 @@ bool CheckDeclaration::visit(FunctionDefinitionAST *ast) fun->setVirtual(ty.isVirtual()); if (ty.isDeprecated()) fun->setDeprecated(true); + if (ty.isUnavailable()) + fun->setUnavailable(true); fun->setStartOffset(tokenAt(ast->firstToken()).offset); fun->setEndOffset(tokenAt(ast->lastToken()).offset); if (ast->declarator) @@ -727,6 +737,8 @@ bool CheckDeclaration::visit(ObjCMethodDeclarationAST *ast) symbol->setVisibility(semantic()->currentObjCVisibility()); if (ty.isDeprecated()) symbol->setDeprecated(true); + if (ty.isUnavailable()) + symbol->setUnavailable(true); _scope->enterSymbol(symbol); diff --git a/src/shared/cplusplus/CheckSpecifier.cpp b/src/shared/cplusplus/CheckSpecifier.cpp index 183962f66d4af23407653e411f5b6c6031e186dd..ee390d285f6d37363dc8c09c164130454531c0bb 100644 --- a/src/shared/cplusplus/CheckSpecifier.cpp +++ b/src/shared/cplusplus/CheckSpecifier.cpp @@ -346,6 +346,8 @@ bool CheckSpecifier::visit(ClassSpecifierAST *ast) if (_fullySpecifiedType.isDeprecated()) klass->setDeprecated(true); + if (_fullySpecifiedType.isUnavailable()) + klass->setUnavailable(true); for (BaseSpecifierListAST *it = ast->base_clause_list; it; it = it->next) { BaseSpecifierAST *base = it->value; diff --git a/src/shared/cplusplus/Symbol.cpp b/src/shared/cplusplus/Symbol.cpp index 63672f13c0064e91cb9056eaafa5861de0bd7d03..1b38da597beabed68370da6933c7f20599eec38f 100644 --- a/src/shared/cplusplus/Symbol.cpp +++ b/src/shared/cplusplus/Symbol.cpp @@ -170,7 +170,9 @@ Symbol::Symbol(TranslationUnit *translationUnit, unsigned sourceLocation, const _scope(0), _index(0), _next(0), - _isGenerated(false) + _isGenerated(false), + _isDeprecated(false), + _isUnavailable(false) { setSourceLocation(sourceLocation, translationUnit); setName(name); @@ -206,6 +208,12 @@ bool Symbol::isDeprecated() const void Symbol::setDeprecated(bool isDeprecated) { _isDeprecated = isDeprecated; } +bool Symbol::isUnavailable() const +{ return _isUnavailable; } + +void Symbol::setUnavailable(bool isUnavailable) +{ _isUnavailable = isUnavailable; } + void Symbol::setSourceLocation(unsigned sourceLocation, TranslationUnit *translationUnit) { _sourceLocation = sourceLocation; diff --git a/src/shared/cplusplus/Symbol.h b/src/shared/cplusplus/Symbol.h index e0fe2b01be9879971ec21c75819cd8537e9e5038..98ce58bd8d4734f3a56f661bbe5bf5fd598fb3d8 100644 --- a/src/shared/cplusplus/Symbol.h +++ b/src/shared/cplusplus/Symbol.h @@ -287,6 +287,9 @@ public: bool isDeprecated() const; void setDeprecated(bool isDeprecated); + bool isUnavailable() const; + void setUnavailable(bool isUnavailable); + Symbol *enclosingSymbol() const; /// Returns the eclosing namespace scope. @@ -332,6 +335,7 @@ private: bool _isGenerated: 1; bool _isDeprecated: 1; + bool _isUnavailable: 1; class IdentityForName; class HashCode;