CodeQL library for C/C++

Member predicate BlockStmt::getLastStmtIn

Gets the last body statement of this block. If this last statement is itself a block, returns the last statement of that block, and so on.

For example, for the block

{ int a; int b = 1; { a = b; } }

the result is the expression statement a = b.

Stmt getLastStmtIn()