diff options
| author | Rob Boehne | 2021-01-21 15:50:49 -0600 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-05-09 18:05:39 +0200 |
| commit | d61fe3ecc3c953cc92abdbbd25eae09b62c60849 (patch) | |
| tree | 4a7b0cf79572557dea2c5da41266c8b1f5e0ec83 /src | |
| parent | b325c6d81e2abf945529a3baf0619b5a696e464f (diff) | |
| download | catch3-d61fe3ecc3c953cc92abdbbd25eae09b62c60849.tar.gz | |
[Issue 2154] Correct error when building with IBM's latest XLC (#2155)
* [Issue 2154] Correct error when building with IBM's latest XLC compiler with xlclang++ front-end.
On AIX, the XLC 16.1.0.1 compiler considers the call to `std::abs` ambigious, so it needs help with a static_cast to the type of the template argument.
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/catch2/matchers/catch_matchers_floating_point.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/catch2/matchers/catch_matchers_floating_point.cpp b/src/catch2/matchers/catch_matchers_floating_point.cpp index fc5d9165..b3c1c335 100644 --- a/src/catch2/matchers/catch_matchers_floating_point.cpp +++ b/src/catch2/matchers/catch_matchers_floating_point.cpp @@ -54,7 +54,8 @@ namespace { return lhs == rhs; } - auto ulpDiff = std::abs(lc - rc); + // static cast as a workaround for IBM XLC + auto ulpDiff = std::abs(static_cast<FP>(lc - rc)); return static_cast<uint64_t>(ulpDiff) <= maxUlpDiff; } |