C++: Add cases for conditional and comma operator in AV RUle 82

This commit is contained in:
Mathias Vorreiter Pedersen
2020-09-07 08:59:08 +02:00
parent eea893483d
commit b3d18ef610

View File

@@ -45,6 +45,16 @@ predicate dereferenceThis(Expr e) {
or
// `*this = ...` (where `=` is not overloaded, so an `AssignExpr`)
dereferenceThis(e.(AssignExpr).getLValue())
or
// `e ? ... : ... `
exists(ConditionalExpr cond |
cond = e and
dereferenceThis(cond.getThen()) and
dereferenceThis(cond.getElse())
)
or
// `..., ... `
dereferenceThis(e.(CommaExpr).getRightOperand())
}
/**