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