CodeQL library for C/C++
codeql/cpp-all 2.1.1-dev (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()