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

Member predicate ForStmt::getCondition

Gets the condition expression of this ‘for’ statement.

For example, for

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

the result is i < 10.

Does not hold if the condition expression is omitted, as in

for (i = 0;; i++) { if (i >= 10) break; }
Expr getCondition()