[Libreoffice-commits] core.git: compilerplugins/clang

Noel Grandin noel.grandin at collabora.co.uk
Fri Feb 17 07:37:54 UTC 2017


 compilerplugins/clang/unusedenumconstants.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 72356f947b096fc4cc89f1b07ce5ee55047813b0
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Feb 17 09:35:02 2017 +0200

    teach loplugin unusedenumconstants about CXXOperatorCallExpr
    
    fixes some false+ in the write-only analysis
    
    Change-Id: Ie7905c05c8012820c640064d451b33badb04c5fc

diff --git a/compilerplugins/clang/unusedenumconstants.cxx b/compilerplugins/clang/unusedenumconstants.cxx
index 2500451..8ba5d23 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)


More information about the Libreoffice-commits mailing list