| 5890 | } |
| 5891 | |
| 5892 | std::vector<const Scope*> Scope::findAssociatedScopes() const |
| 5893 | { |
| 5894 | std::vector<const Scope*> result = {this}; |
| 5895 | if (isClassOrStruct() && definedType && !definedType->derivedFrom.empty()) { |
| 5896 | const std::vector<Type::BaseInfo>& derivedFrom = definedType->derivedFrom; |
| 5897 | for (const Type::BaseInfo& i : derivedFrom) { |
| 5898 | const Type* base = i.type; |
| 5899 | if (base && base->classScope) { |
| 5900 | if (contains(result, base->classScope)) |
| 5901 | continue; |
| 5902 | std::vector<const Scope*> baseScopes = base->classScope->findAssociatedScopes(); |
| 5903 | result.insert(result.end(), baseScopes.cbegin(), baseScopes.cend()); |
| 5904 | } |
| 5905 | } |
| 5906 | } |
| 5907 | return result; |
| 5908 | } |
| 5909 | |
| 5910 | //--------------------------------------------------------------------------- |
| 5911 |
no test coverage detected