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

Member predicate IfStmt::hasElse

Holds if this ‘if’ statement has an ‘else’ statement.

For example, this holds for

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

but not for

if (b) { x = 1; }
predicate hasElse()