summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/constparams.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-15 09:49:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-15 11:36:05 +0200
commit2c83c40b4358330f7360b66b8506997ffd80bcde (patch)
treea68a0be99013f51f892e36924f9e65acfa266143 /compilerplugins/clang/constparams.cxx
parent416752b9e4bc4605c479d3eff7797be9f0ef2a38 (diff)
improve unusedfields loplugin
to ignore assignments when doing writeonly analysis Change-Id: I9eb6f2594003a610582dbc20acb7ccf14ef72c6c
Diffstat (limited to 'compilerplugins/clang/constparams.cxx')
-rw-r--r--compilerplugins/clang/constparams.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx
index ad5549d02263..95325c57d1a7 100644
--- a/compilerplugins/clang/constparams.cxx
+++ b/compilerplugins/clang/constparams.cxx
@@ -194,8 +194,7 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt)
return checkIfCanBeConst(parent);
}
return true;
- } else if (isa<BinaryOperator>(parent)) {
- const BinaryOperator* binaryOp = dyn_cast<BinaryOperator>(parent);
+ } else if (auto binaryOp = dyn_cast<BinaryOperator>(parent)) {
BinaryOperator::Opcode op = binaryOp->getOpcode();
// TODO could do better, but would require tracking the LHS
if (binaryOp->getRHS() == stmt && op == BO_Assign) {