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

Member predicate ConstevalIfStmt::hasRuntimeEvaluatedBranch

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

For example, this holds for

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

but not for

if consteval { return true; }
predicate hasRuntimeEvaluatedBranch()