teach loplugin unusedenumconstants about CXXOperatorCallExpr

fixes some false+ in the write-only analysis

Change-Id: Ie7905c05c8012820c640064d451b33badb04c5fc
This commit is contained in:
Noel Grandin
2017-02-17 09:35:02 +02:00
parent 80dd757500
commit 72356f947b

View File

@@ -164,6 +164,13 @@ try_again:
} else {
bRead = true;
}
} else if (const CXXOperatorCallExpr * operatorCall = dyn_cast<CXXOperatorCallExpr>(parent))
{
if (operatorCall->isAssignmentOp()) {
bWrite = true;
} else {
bRead = true;
}
} else if (isa<CastExpr>(parent) || isa<UnaryOperator>(parent)
|| isa<ConditionalOperator>(parent) || isa<ParenExpr>(parent)
|| isa<MaterializeTemporaryExpr>(parent)