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

Member predicate ConstexprIfStmt::hasElse

Holds if this ‘constexpr if’ statement has an ‘else’ statement.

For example, this holds for

if constexpr (b) { x = 1; } else { x = 2; }

but not for

if constexpr (b) { x = 1; }
predicate hasElse()