You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
IBM has nearly complete support for C++11 in 16.1.0 with the xlclang++ front-end, but is tripped up by what it considers to be an ambiguous call to std::abs
Reproduction steps
Build on AIX with xlclang++ using catch2 header <catch2/catch.hpp> (i.e. build catch2 tests with CMake)
Platform information:
OS: AIX 7.1
Compiler+version: XLC 16.1.0.1
Catch version: v2.13.4
Additional context
With a patch to add a static_cast<> to the argument to std::abs Catch2 build
[ 50%] Building CXX object source_subfolder/CMakeFiles/Catch2WithMain.dir/src/catch_with_main.cpp.o
cd /home/robb/.conan/data/catch2/2.13.4/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/build_subfolder/source_subfolder && /opt/IBM/xlC/16.1.0/bin/xlclang++ -x c++ -I/home/robb/.conan/data/catch2/2.13.4/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/single_include -qarch=pwr8 -qaltivec -qtls=global-dynamic -qpic=large -O -std=gnu++11 -o CMakeFiles/Catch2WithMain.dir/src/catch_with_main.cpp.o -c /home/robb/.conan/data/catch2/2.13.4/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/src/catch_with_main.cpp
In file included from /home/robb/.conan/data/catch2/2.13.4/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/src/catch_with_main.cpp:2:
/home/robb/.conan/data/catch2/2.13.4/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/single_include/catch2/catch.hpp:11450:24: error:
call to 'abs' is ambiguous
auto ulpDiff = std::abs(lc - rc);
^~~~~~~~
/home/robb/.conan/data/catch2/2.13.4/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/single_include/catch2/catch.hpp:11535:20: note:
in instantiation of function template specialization 'Catch::(anonymous namespace)::almostEqualUlps<double>' requested here
return almostEqualUlps<double>(matchee, m_target, m_ulps);
^
/opt/IBM/xlC/16.1.0/include2/aix/stdlib.h:851:18: note: candidate function
inline int abs (int __n) { return __abs(__n);}
^
/opt/IBM/xlC/16.1.0/include2/c++/math.h:733:1: note: candidate function
abs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);}
^
/opt/IBM/xlC/16.1.0/include2/c++/math.h:737:1: note: candidate function
abs(double __lcpp_x) _NOEXCEPT {return ::fabs(__lcpp_x);}
^
/opt/IBM/xlC/16.1.0/include2/c++/math.h:741:1: note: candidate function
abs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
^
1 error generated.
Error while processing /home/robb/.conan/data/catch2/2.13.4/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/source_subfolder/src/catch_with_main.cpp.
gmake[2]: *** [source_subfolder/CMakeFiles/Catch2WithMain.dir/build.make:82: source_subfolder/CMakeFiles/Catch2WithMain.dir/src/catch_with_main.cpp.o] Error 1
The text was updated successfully, but these errors were encountered:
Describe the bug
IBM has nearly complete support for C++11 in 16.1.0 with the xlclang++ front-end, but is tripped up by what it considers to be an ambiguous call to
std::abs
Reproduction steps
Build on AIX with xlclang++ using catch2 header
<catch2/catch.hpp>
(i.e. build catch2 tests with CMake)Platform information:
Additional context
With a patch to add a
static_cast<>
to the argument tostd::abs
Catch2 buildThe text was updated successfully, but these errors were encountered: