| 2170 | |
| 2171 | namespace { |
| 2172 | const Function* getFunctionForArgumentvariable(const Variable * const var) |
| 2173 | { |
| 2174 | if (const Scope* scope = var->nameToken()->scope()) { |
| 2175 | auto it = std::find_if(scope->functionList.begin(), scope->functionList.end(), [&](const Function& function) { |
| 2176 | for (nonneg int arg = 0; arg < function.argCount(); ++arg) { |
| 2177 | if (var == function.getArgumentVar(arg)) |
| 2178 | return true; |
| 2179 | } |
| 2180 | return false; |
| 2181 | }); |
| 2182 | if (it != scope->functionList.end()) |
| 2183 | return &*it; |
| 2184 | } |
| 2185 | return nullptr; |
| 2186 | } |
| 2187 | } |
| 2188 | |
| 2189 | void SymbolDatabase::validateVariables() const |
no test coverage detected