[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libreoffice-commits
Subject:    [Libreoffice-commits] core.git: compilerplugins/clang
From:       logerrit () kemper ! freedesktop ! org (Libreoffice Gerrit user)
Date:       2018-11-30 15:00:24
Message-ID: 20181130150024.CC236761D7 () kemper ! freedesktop ! org
[Download RAW message or body]

 compilerplugins/clang/implicitboolconversion.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 9eff2ebf388fc967409590d050037cc7400ceec4
Author:     Stephan Bergmann <sbergman@redhat.com>
AuthorDate: Fri Nov 30 11:38:19 2018 +0100
Commit:     Stephan Bergmann <sbergman@redhat.com>
CommitDate: Fri Nov 30 15:59:54 2018 +0100

    Make some loplugin:implicitboolconversion code use TypeCheck
    
    Change-Id: If675d629784894573085122beadc6abc3e67f457
    Reviewed-on: https://gerrit.libreoffice.org/64335
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman@redhat.com>

diff --git a/compilerplugins/clang/implicitboolconversion.cxx \
b/compilerplugins/clang/implicitboolconversion.cxx index 8080c1c2ae13..a6ff1c53c26d \
                100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -654,12 +654,9 @@ bool ImplicitBoolConversion::TraverseBinAssign(BinaryOperator * \
expr) {  if (fd != nullptr && fd->isBitField()
             && fd->getBitWidthValue(compiler.getASTContext()) == 1)
         {
-            TypedefType const * t = fd->getType()->getAs<TypedefType>();
-            if (t != nullptr)
-            {
-                std::string sTypeName = t->getDecl()->getNameAsString();
-                bExt = (sTypeName == "guint" || sTypeName == "quint64");
-            }
+            auto const check = loplugin::TypeCheck(fd->getType());
+            bExt = check.Typedef("guint").GlobalNamespace()
+                || check.Typedef("quint64").GlobalNamespace();
         }
     }
     assert(!nested.empty());
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic