C++: The update of a for-loop is ExprInVoidContext

This commit is contained in:
Jonas Jensen
2019-10-24 15:27:54 +02:00
parent edc9e23a9d
commit 6c069ff444

View File

@@ -36,6 +36,8 @@ private predicate exprInVoidContext(Expr e) {
exists(CommaExpr c | c.getLeftOperand() = e)
or
exists(CommaExpr c | c.getRightOperand() = e and c instanceof ExprInVoidContext)
or
exists(ForStmt for | for.getUpdate() = e)
) and
not e.getActualType() instanceof VoidType
}