| 2504 | } |
| 2505 | |
| 2506 | bool isMutableExpression(const Token* tok) |
| 2507 | { |
| 2508 | if (!tok) |
| 2509 | return false; |
| 2510 | if (tok->isLiteral() || tok->isKeyword() || tok->isStandardType() || tok->isEnumerator()) |
| 2511 | return false; |
| 2512 | if (Token::Match(tok, ",|;|:|]|)|}")) |
| 2513 | return false; |
| 2514 | if (Token::simpleMatch(tok, "[ ]")) |
| 2515 | return false; |
| 2516 | if (tok->previous() && tok->previous()->isKeyword() && Token::Match(tok->previous(), "%name% (")) |
| 2517 | return false; |
| 2518 | if (tok->link() && Token::Match(tok, "<|>")) |
| 2519 | return false; |
| 2520 | if (tok->astOperand1() && Token::simpleMatch(tok, "[")) |
| 2521 | return isMutableExpression(tok->astOperand1()); |
| 2522 | if (const Variable* var = tok->variable()) { |
| 2523 | if (var->isConst() && !var->isPointer() && (!var->isArray() || !var->isArgument())) |
| 2524 | return false; |
| 2525 | } |
| 2526 | return true; |
| 2527 | } |
| 2528 | |
| 2529 | bool isVariableChangedByFunctionCall(const Token *tok, int indirect, const Settings &settings, bool *inconclusive) |
| 2530 | { |
no test coverage detected