CodeQL library for C/C++
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()