| 2693 | } |
| 2694 | |
| 2695 | Token* findLambdaEndScope(Token* tok) |
| 2696 | { |
| 2697 | if (!Token::simpleMatch(tok, "[")) |
| 2698 | return nullptr; |
| 2699 | tok = tok->link(); |
| 2700 | if (!Token::Match(tok, "] (|{")) |
| 2701 | return nullptr; |
| 2702 | tok = tok->linkAt(1); |
| 2703 | if (Token::simpleMatch(tok, "}")) |
| 2704 | return tok; |
| 2705 | if (Token::simpleMatch(tok, ") {")) |
| 2706 | return tok->linkAt(1); |
| 2707 | if (!Token::simpleMatch(tok, ")")) |
| 2708 | return nullptr; |
| 2709 | tok = tok->next(); |
| 2710 | while (Token::Match(tok, "mutable|constexpr|consteval|noexcept|.")) { |
| 2711 | if (Token::simpleMatch(tok, "noexcept (")) |
| 2712 | tok = tok->linkAt(1); |
| 2713 | if (Token::simpleMatch(tok, ".")) { |
| 2714 | tok = findTypeEnd(tok); |
| 2715 | break; |
| 2716 | } |
| 2717 | tok = tok->next(); |
| 2718 | } |
| 2719 | if (Token::simpleMatch(tok, "{")) |
| 2720 | return tok->link(); |
| 2721 | return nullptr; |
| 2722 | } |
| 2723 | const Token* findLambdaEndScope(const Token* tok) { |
| 2724 | return findLambdaEndScope(const_cast<Token*>(tok)); |
| 2725 | } |
no test coverage detected