* is tok the start brace { of a class, struct, union, or enum */
| 104 | * is tok the start brace { of a class, struct, union, or enum |
| 105 | */ |
| 106 | static const Token* isClassStructUnionEnumStart(const Token* tok) |
| 107 | { |
| 108 | if (!Token::Match(tok->previous(), "class|struct|union|enum|%name%|>|>> {")) |
| 109 | return nullptr; |
| 110 | const Token * tok2 = tok->previous(); |
| 111 | while (tok2 && !Token::Match(tok2, "class|struct|union|enum|{|}|)|;")) |
| 112 | tok2 = tok2->previous(); |
| 113 | return (Token::Match(tok2, "class|struct|union|enum") && !Token::simpleMatch(tok2->tokAt(-1), "->")) ? tok2 : nullptr; |
| 114 | } |
| 115 | |
| 116 | //--------------------------------------------------------------------------- |
| 117 |
no test coverage detected