compilerplugins/clang/implicitboolconversion.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
New commits: commit 9eff2ebf388fc967409590d050037cc7400ceec4 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Fri Nov 30 11:38:19 2018 +0100 Commit: Stephan Bergmann <sberg...@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 <sberg...@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-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits