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

Member predicate ConstexprIfStmt :: getElse

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

For example, for

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

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

if constexpr (b) { x = 1; }

there is no result.

Stmt getElse ( )