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