CodeQL library for C/C++
Search

Member predicate SwitchStmt::getStmt

Gets the body statement of this ‘switch’ statement.

In almost all cases the result will be a BlockStmt, but there are other syntactically valid constructions.

For example, for

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

the result is

{
    case 1:
    case 2:
    break;
    default:
    break;
}
Stmt getStmt()