CodeQL library for C/C++
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()