[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - compilerplugins/clang

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 29 18:35:57 UTC 2018


 compilerplugins/clang/implicitboolconversion.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit a197348d1a40245b0858bb1b4021d978c13dff84
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sun Sep 30 19:38:44 2018 +0000
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Thu Nov 29 19:28:03 2018 +0100

    implicitboolconversion: ignore quint64 bitfield
    
    Change-Id: I97380455b9f526b75c7d3855d188d2f659035ba2
    Reviewed-on: https://gerrit.libreoffice.org/61170
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/compilerplugins/clang/implicitboolconversion.cxx b/compilerplugins/clang/implicitboolconversion.cxx
index d7e80f56ab36..c3834c8054db 100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -641,10 +641,12 @@ bool ImplicitBoolConversion::TraverseBinNE(BinaryOperator * expr) {
 bool ImplicitBoolConversion::TraverseBinAssign(BinaryOperator * expr) {
     nested.push(std::vector<ImplicitCastExpr const *>());
     bool bRet = RecursiveASTVisitor::TraverseBinAssign(expr);
-    // /usr/include/gtk-2.0/gtk/gtktogglebutton.h: struct _GtkToggleButton:
+    // gtk-2.0/gtk/gtktogglebutton.h: struct _GtkToggleButton:
     //  guint GSEAL (active) : 1;
     // even though <http://www.gtk.org/api/2.6/gtk/GtkToggleButton.html>:
     //  "active"               gboolean              : Read / Write
+    // qt5/QtGui/qaccessible.h: struct State:
+    //  quint64 disabled : 1;
     bool bExt = false;
     MemberExpr const * me = dyn_cast<MemberExpr>(expr->getLHS());
     if (me != nullptr) {
@@ -653,7 +655,11 @@ bool ImplicitBoolConversion::TraverseBinAssign(BinaryOperator * expr) {
             && fd->getBitWidthValue(compiler.getASTContext()) == 1)
         {
             TypedefType const * t = fd->getType()->getAs<TypedefType>();
-            bExt = t != nullptr && t->getDecl()->getNameAsString() == "guint";
+            if (t != nullptr)
+            {
+                std::string sTypeName = t->getDecl()->getNameAsString();
+                bExt = (sTypeName == "guint" || sTypeName == "quint64");
+            }
         }
     }
     assert(!nested.empty());


More information about the Libreoffice-commits mailing list