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

Stephan Bergmann sbergman at redhat.com
Sat Nov 25 09:06:14 UTC 2017


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

New commits:
commit f82dc45bdb9e930878447015291c5b90c9325b57
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 24 18:31:14 2017 +0100

    Use the canonical TemplateDecl
    
    ...in case there are multiple, as is the case at least with recent (towards
    GCC 8) libstdc++, where std::pair is forward-declared also in
    include/c++/8.0.0/bits/stl_iterator.h, so that in
    dbaccess/source/ui/dlg/DbAdminImpl.cxx
    
        std::pair< Reference<XConnection>,sal_Bool> aRet;
        aRet.second = false;
    
    failed to reconstruct the sal_Bool template argument and issued a
    loplugin:implicitboolconversion warning.
    
    Change-Id: I0054f2596d3f8837b857f1dca2f25952828b12cc
    Reviewed-on: https://gerrit.libreoffice.org/45254
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/compilerplugins/clang/implicitboolconversion.cxx b/compilerplugins/clang/implicitboolconversion.cxx
index c695148b790e..5c658fd9c715 100644
--- a/compilerplugins/clang/implicitboolconversion.cxx
+++ b/compilerplugins/clang/implicitboolconversion.cxx
@@ -159,6 +159,7 @@ bool isBoolExpr(Expr const * expr) {
                 if (td == nullptr) {
                     break;
                 }
+                td = cast<TemplateDecl>(td->getCanonicalDecl());
                 TemplateParameterList const * ps = td->getTemplateParameters();
                 SubstTemplateTypeParmType const * t2
                     = getAsSubstTemplateTypeParmType(


More information about the Libreoffice-commits mailing list