MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / isThisChanged

Function isThisChanged

lib/astutils.cpp:3054–3068  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3052}
3053
3054bool isThisChanged(const Token* tok, int indirect, const Settings& settings)
3055{
3056 if ((Token::Match(tok->previous(), "%name% (") && !Token::simpleMatch(tok->astOperand1(), ".")) ||
3057 Token::Match(tok->tokAt(-3), "this . %name% (")) {
3058 if (tok->previous()->function()) {
3059 return (!tok->previous()->function()->isConst() && !tok->previous()->function()->isStatic());
3060 }
3061 if (!tok->previous()->isKeyword() || tok->previous()->isOperatorKeyword()) {
3062 return true;
3063 }
3064 }
3065 if (isVariableChanged(tok, indirect, settings))
3066 return true;
3067 return false;
3068}
3069
3070static const Token* findThisChanged(const Token* start, const Token* end, int indirect, const Settings& settings)
3071{

Callers 2

isThisModifiedFunction · 0.85
findThisChangedFunction · 0.85

Calls 7

isVariableChangedFunction · 0.85
astOperand1Method · 0.80
isConstMethod · 0.80
simpleMatchFunction · 0.70
tokAtMethod · 0.45
functionMethod · 0.45
isKeywordMethod · 0.45

Tested by

no test coverage detected