compilerplugins/clang/unusedfields.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit b533b2748e0f0ce4d5263f5f5720280c51803e25
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Tue Jul 11 16:01:02 2017 +0200

    unusedfields plugin needs to ignore fields that have reinterpret_cast on 
them
    
    Change-Id: Ie8570de6a4eafc95352899fbfd1447d7c3a84e1a

diff --git a/compilerplugins/clang/unusedfields.cxx 
b/compilerplugins/clang/unusedfields.cxx
index 3de31c3c8ae6..72354f757d90 100644
--- a/compilerplugins/clang/unusedfields.cxx
+++ b/compilerplugins/clang/unusedfields.cxx
@@ -305,7 +305,13 @@ void UnusedFields::checkWriteOnly(const FieldDecl* 
fieldDecl, const Expr* member
                 return;
             break;
         }
-        if (isa<CastExpr>(parent) || isa<MemberExpr>(parent) || 
isa<ParenExpr>(parent) || isa<ParenListExpr>(parent)
+        if (isa<CXXReinterpretCastExpr>(parent))
+        {
+            // once we see one of these, there is not much useful we can know
+            bPotentiallyReadFrom = true;
+            break;
+        }
+        else if (isa<CastExpr>(parent) || isa<MemberExpr>(parent) || 
isa<ParenExpr>(parent) || isa<ParenListExpr>(parent)
 #if CLANG_VERSION >= 40000
              || isa<ArrayInitLoopExpr>(parent)
 #endif
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to