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