summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/unusedenumconstants.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/unusedenumconstants.cxx')
-rw-r--r--compilerplugins/clang/unusedenumconstants.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/compilerplugins/clang/unusedenumconstants.cxx b/compilerplugins/clang/unusedenumconstants.cxx
index 2500451b803a..8ba5d23f8485 100644
--- a/compilerplugins/clang/unusedenumconstants.cxx
+++ b/compilerplugins/clang/unusedenumconstants.cxx
@@ -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)