| 5839 | } |
| 5840 | |
| 5841 | void Scope::findFunctionInBase(const Token* tok, nonneg int args, std::vector<const Function *> & matches) const |
| 5842 | { |
| 5843 | if (isClassOrStruct() && definedType && !definedType->derivedFrom.empty()) { |
| 5844 | const std::vector<Type::BaseInfo> &derivedFrom = definedType->derivedFrom; |
| 5845 | for (const Type::BaseInfo & i : derivedFrom) { |
| 5846 | const Type *base = i.type; |
| 5847 | if (base && base->classScope) { |
| 5848 | if (base->classScope == this) // Ticket #5120, #5125: Recursive class; tok should have been found already |
| 5849 | continue; |
| 5850 | |
| 5851 | auto range = base->classScope->functionMap.equal_range(tok->str()); |
| 5852 | for (auto it = range.first; it != range.second; ++it) { |
| 5853 | const Function *func = it->second; |
| 5854 | if (func->isDestructor() && !Token::simpleMatch(tok->tokAt(-1), "~")) |
| 5855 | continue; |
| 5856 | if ((func->isVariadic() && args >= (func->argCount() - 1)) || |
| 5857 | (args == func->argCount() || (args < func->argCount() && args >= func->minArgCount()))) { |
| 5858 | matches.push_back(func); |
| 5859 | } |
| 5860 | } |
| 5861 | |
| 5862 | base->classScope->findFunctionInBase(tok, args, matches); |
| 5863 | } |
| 5864 | } |
| 5865 | } |
| 5866 | } |
| 5867 | |
| 5868 | const Scope *Scope::findRecordInBase(const std::string & name) const |
| 5869 | { |
nothing calls this directly
no test coverage detected