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