CodeQL library for C/C++
codeql/cpp-all 0.12.10 (changelog, source)
Search

Member predicate SwitchCase::terminatesInReturnStmt

Holds if the last statement, as determined by getLastStmt, under this ‘switch case’ statement is a ‘return’ statement.

For example, for

switch (i) {
case 5:
    x = 1;
    return;
case 6:
case 7:
    { x = 2; return; }
default:
    { x = 3; { x = 4; return; } }
}

this holds for case 5:, case 7: and default:, but not for case 6:.

predicate terminatesInReturnStmt()