| 5818 | } |
| 5819 | |
| 5820 | bool Scope::hasInlineOrLambdaFunction(const Token** tokStart, bool onlyInline) const |
| 5821 | { |
| 5822 | return std::any_of(nestedList.begin(), nestedList.end(), [&](const Scope* s) { |
| 5823 | // Inline function |
| 5824 | if (s->type == ScopeType::eUnconditional && Token::simpleMatch(s->bodyStart->previous(), ") {")) { |
| 5825 | if (tokStart) |
| 5826 | *tokStart = nullptr; // bailout for e.g. loop-like macros |
| 5827 | return true; |
| 5828 | } |
| 5829 | // Lambda function |
| 5830 | if (!onlyInline && s->type == ScopeType::eLambda && !hasEmptyCaptureList(s->bodyStart)) { |
| 5831 | if (tokStart) |
| 5832 | *tokStart = s->bodyStart; |
| 5833 | return true; |
| 5834 | } |
| 5835 | if (s->hasInlineOrLambdaFunction(tokStart, onlyInline)) |
| 5836 | return true; |
| 5837 | return false; |
| 5838 | }); |
| 5839 | } |
| 5840 | |
| 5841 | void Scope::findFunctionInBase(const Token* tok, nonneg int args, std::vector<const Function *> & matches) const |
| 5842 | { |
no test coverage detected