CodeQL library for C/C++
codeql/cpp-all 1.1.0 (changelog, source)

Member predicate BlockStmt::getIndexOfStmt

Gets the index of the given statement within this block, indexed from 0.

For example, for the block

{ int a; int b = 1; a = b; }

if s is the expression statement a = b then getIndexOfStmt(s) has result 2.

int getIndexOfStmt(Stmt s)