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

Function isSimpleIndexExpression

lib/fwdanalysis.cpp:413–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413static bool isSimpleIndexExpression(const Token* tok)
414{
415 const Token* idx = tok->astOperand2();
416 if (!idx)
417 return false;
418 if (idx->isIncDecOp())
419 idx = idx->astOperand1();
420 return idx->variable() && idx->variable()->scope() == tok->scope();
421}
422
423std::set<nonneg int> FwdAnalysis::getExprVarIds(const Token* expr, bool* localOut, bool* unknownVarIdOut) const
424{

Callers 1

fwdanalysis.cppFile · 0.85

Calls 4

astOperand2Method · 0.80
astOperand1Method · 0.80
variableMethod · 0.80
scopeMethod · 0.80

Tested by

no test coverage detected