[Libreoffice-commits] core.git: compilerplugins/clang

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue May 11 13:00:46 UTC 2021


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

New commits:
commit a5c37adc47d91176bdd64250a1f44f26b36215ac
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue May 11 13:28:35 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue May 11 14:59:59 2021 +0200

    loplugin:implicitboolconversion workaround
    
    after
        commit eb6819e74a66750235d3a4a894479faeee8146e2
        Date:   Sat May 1 22:13:37 2021 +0900
        change usage of boost::hash_combine to o3tl::hash_combine
    
    Change-Id: Idc70726f7e762b49111e6505ba3f978370d7cf7c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115399
    Reviewed-by: Tor Lillqvist <tml at collabora.com>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Jenkins

diff --git a/compilerplugins/clang/implicitboolconversion.cxx b/compilerplugins/clang/implicitboolconversion.cxx
index 14574e3cd420..7e708eb49843 100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -907,6 +907,12 @@ void ImplicitBoolConversion::reportWarning(ImplicitCastExpr const * expr) {
                 }
             }
         }
+
+        // ignore template magic
+        StringRef aFileName = getFilenameOfLocation(compiler.getSourceManager().getSpellingLoc(compat::getBeginLoc(expr)));
+        if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/include/o3tl/hash_combine.hxx"))
+            return;
+
         report(
             DiagnosticsEngine::Warning,
             "implicit conversion (%0) from %1 to %2", compat::getBeginLoc(expr))


More information about the Libreoffice-commits mailing list