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