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

Member predicate ConstevalIfStmt::getElse

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

For example, for

if consteval { return true; } else { return false; }

the result is the BlockStmt { return false; }, and for

if consteval { return true; }

there is no result.

Stmt getElse()