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

Member predicate SwitchStmt::hasDefaultCase

Holds if this ‘switch’ statement has a ‘default case’ statement.

For example, this holds for

switch(i) {
    case 1:
    case 2:
    break;
    default:
    break;
}

but not for

switch(i) {
    case 1:
    case 2:
    break;
}
predicate hasDefaultCase()