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

Noel Grandin noel at peralex.com
Mon Jul 25 07:45:07 UTC 2016


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

New commits:
commit 69dbf6f08604f6a97390fb7ab06dfe86c1cf05a0
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jul 25 09:44:06 2016 +0200

    clang 3.8 does not seem to have EvaluateAsFloat
    
    Change-Id: I0d846a2e9bc6db192cbf8f5dbce104c11ff409b4

diff --git a/compilerplugins/clang/overrideparam.cxx b/compilerplugins/clang/overrideparam.cxx
index be76b5b..aca1e95 100644
--- a/compilerplugins/clang/overrideparam.cxx
+++ b/compilerplugins/clang/overrideparam.cxx
@@ -160,12 +160,14 @@ bool OverrideParam::hasSameDefaultParams(const ParmVarDecl * parmVarDecl, const
     {
         return x1 == x2;
     }
+#if CLANG_VERSION >= 30900
     APFloat f1(0.0f), f2(0.0f);
     if (defaultArgExpr->EvaluateAsFloat(f1, compiler.getASTContext())
         && superDefaultArgExpr->EvaluateAsFloat(f2, compiler.getASTContext()))
     {
         return f1.bitwiseIsEqual(f2);
     }
+#endif
     // catch params with defaults like "= OUString()"
     if (isa<MaterializeTemporaryExpr>(defaultArgExpr)
         && isa<MaterializeTemporaryExpr>(superDefaultArgExpr))
@@ -177,7 +179,11 @@ bool OverrideParam::hasSameDefaultParams(const ParmVarDecl * parmVarDecl, const
     {
         return true;
     }
+#if CLANG_VERSION >= 30900
     return false;
+#else
+    return true; // clang3-8 doesn't have EvaluateAsFloat, so we can't be as precise
+#endif
 }
 
 


More information about the Libreoffice-commits mailing list