| 5265 | } |
| 5266 | |
| 5267 | const Variable *Scope::getVariable(const std::string &varname) const |
| 5268 | { |
| 5269 | auto it = std::find_if(varlist.begin(), varlist.end(), [&varname](const Variable& var) { |
| 5270 | return var.name() == varname; |
| 5271 | }); |
| 5272 | if (it != varlist.end()) |
| 5273 | return &*it; |
| 5274 | |
| 5275 | if (definedType) { |
| 5276 | for (const Type::BaseInfo& baseInfo: definedType->derivedFrom) { |
| 5277 | if (baseInfo.type && baseInfo.type->classScope) { |
| 5278 | if (const Variable* var = baseInfo.type->classScope->getVariable(varname)) |
| 5279 | return var; |
| 5280 | } |
| 5281 | } |
| 5282 | } |
| 5283 | return nullptr; |
| 5284 | } |
| 5285 | |
| 5286 | static const Token* skipPointers(const Token* tok) |
| 5287 | { |
no test coverage detected