CodeQL library for C/C++
codeql/cpp-all 0.12.9 (changelog, source)
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()