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

Stephan Bergmann sbergman at redhat.com
Wed May 31 10:07:23 UTC 2017


 compilerplugins/clang/cstylecast.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 22a69119293ab94f28ca3120362b95eb38ba78d9
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed May 31 12:05:43 2017 +0200

    The updated values of t1, t2 are unused
    
    ...since f1bbda1c26dc16642038ea70288eec60b43520b6 "loplugin:cstylecast: deal
    with remaining pointer casts"
    
    Change-Id: Idecc702344c674e6f39051e4f8c2114017e317cb

diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx
index addf5edd28ba..62d25acdaf20 100644
--- a/compilerplugins/clang/cstylecast.cxx
+++ b/compilerplugins/clang/cstylecast.cxx
@@ -144,13 +144,9 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) {
     if( expr->getCastKind() == CK_NoOp ) {
         QualType t1 = expr->getSubExpr()->getType();
         QualType t2 = expr->getType();
-        if (t1->isPointerType() && t2->isPointerType()) {
-            t1 = t1->getAs<PointerType>()->getPointeeType();
-            t2 = t2->getAs<PointerType>()->getPointeeType();
-        } else if (t1->isLValueReferenceType() && t2->isLValueReferenceType()) {
-            t1 = t1->getAs<LValueReferenceType>()->getPointeeType();
-            t2 = t2->getAs<LValueReferenceType>()->getPointeeType();
-        } else {
+        if (!((t1->isPointerType() && t2->isPointerType())
+              || (t1->isLValueReferenceType() && t2->isLValueReferenceType())))
+        {
             return true;
         }
         if (isConstCast(


More information about the Libreoffice-commits mailing list