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

Member predicate ConstevalIfStmt::hasCompileTimeEvaluatedBranch

Holds if this ‘(not) constexpr if’ statement has a compile time evaluated statement.

For example, this holds for

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

but not for

if ! consteval { return true; }
predicate hasCompileTimeEvaluatedBranch()