| 2325 | } |
| 2326 | |
| 2327 | static bool isConstTop(const Token *tok) |
| 2328 | { |
| 2329 | if (!tok) |
| 2330 | return false; |
| 2331 | if (!tok->astParent()) |
| 2332 | return true; |
| 2333 | if (Token::simpleMatch(tok->astParent(), ";") && |
| 2334 | Token::Match(tok->astTop()->previous(), "for|if (") && Token::simpleMatch(tok->astTop()->astOperand2(), ";")) { |
| 2335 | if (Token::simpleMatch(tok->astParent()->astParent(), ";")) |
| 2336 | return tok->astParent()->astOperand2() == tok; |
| 2337 | return tok->astParent()->astOperand1() == tok; |
| 2338 | } |
| 2339 | if (Token::simpleMatch(tok, "[")) { |
| 2340 | const Token* bracTok = tok; |
| 2341 | while (Token::simpleMatch(bracTok->astParent(), "[")) |
| 2342 | bracTok = bracTok->astParent(); |
| 2343 | if (!bracTok->astParent()) |
| 2344 | return true; |
| 2345 | } |
| 2346 | if (tok->str() == "," && tok->astParent()->isAssignmentOp()) |
| 2347 | return true; |
| 2348 | return false; |
| 2349 | } |
| 2350 | |
| 2351 | void CheckOtherImpl::checkIncompleteStatement() |
| 2352 | { |
no test coverage detected