[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>
This commit is contained in:
Rob Boehne 2021-01-21 15:50:49 -06:00 committed by Martin Hořeňovský
parent b325c6d81e
commit d61fe3ecc3
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -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;
}