Skip to content

Commit

Permalink
[Issue 2154] Correct error when building with IBM's latest XLC (#2155)
Browse files Browse the repository at this point in the history
* [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>
  • Loading branch information
datalogics-robb and horenmar committed May 9, 2021
1 parent b325c6d commit d61fe3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/catch2/matchers/catch_matchers_floating_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d61fe3e

Please sign in to comment.