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

Member predicate ConstevalIfStmt::getCompileTimeEvaluatedBranch

Gets the statement of this ‘(not) consteval if’ statement evaluated during compile time, 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 getCompileTimeEvaluatedBranch()