CodeQL library for C/C++
Search

Member predicate SwitchStmt::getExpr

Gets the expression that this ‘switch’ statement switches on.

For example, for

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

the result is i.

Expr getExpr()