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

Member predicate ForStmt::getInitialization

Gets the initialization statement of this ‘for’ statement.

For example, for

for (i = 0; i < 10; i++) { j++; }

the result is i = 0;.

Does not hold if the initialization statement is an empty statement, as in

for (; i < 10; i++) { j++; }
Stmt getInitialization()