[Libreoffice-commits] core.git: compilerplugins/clang
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Nov 30 15:00:24 UTC 2018
compilerplugins/clang/implicitboolconversion.cxx | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
New commits:
commit 9eff2ebf388fc967409590d050037cc7400ceec4
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Nov 30 11:38:19 2018 +0100
Commit: Stephan Bergmann <sbergman at 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 at 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());
More information about the Libreoffice-commits
mailing list