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

Member predicate IfStmt :: getElse

Gets the ‘else’ statement of this ‘if’ statement, if any.

For example, for

if (b) { x = 1; } else { x = 2; }

the result is the BlockStmt { x = 2; }, and for

if (b) { x = 1; }

there is no result.

Stmt getElse ( )