diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-25 09:44:06 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-07-25 09:44:06 +0200 |
commit | 69dbf6f08604f6a97390fb7ab06dfe86c1cf05a0 (patch) | |
tree | ccc80bfed15d419353971140bd42e2f4b011b74a /compilerplugins | |
parent | 62462664bef3729c6929ce7e0b1fcb1161219828 (diff) |
clang 3.8 does not seem to have EvaluateAsFloat
Change-Id: I0d846a2e9bc6db192cbf8f5dbce104c11ff409b4
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/overrideparam.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compilerplugins/clang/overrideparam.cxx b/compilerplugins/clang/overrideparam.cxx index be76b5ba9bad..aca1e952ba66 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 } |