Universal is a cross-platform library for plug-in replacement types for C++. With the move to Xcode 15, we have encountered a compilation failure in C++ support.
I am looking for insight into the design of std::isinf/std::isnan to resolve the following compilation failure:
[ 35%] Building CXX object static/fixpnt/binary/CMakeFiles/fixpnt_mod_complex_mul.dir/complex/mod_complex_mul.cpp.o
In file included from /Users/runner/work/universal/universal/static/fixpnt/binary/complex/mod_complex_mul.cpp:7:
In file included from /Users/runner/work/universal/universal/./include/universal/utility/directives.hpp:32:
In file included from /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/iostream:43:
In file included from /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/ios:221:
In file included from /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__locale:18:
In file included from /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/mutex:191:
In file included from /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__memory/shared_ptr.h:42:
In file included from /Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/atomic:2668:
/Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/cmath:607:12: error: no matching function for call to 'isinf'
return std::isinf(__lcpp_x);
^~~~~~~~~~
/Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/complex:598:29: note: in instantiation of function template specialization 'std::__constexpr_isinf<sw::universal::fixpnt<4, 0>>' requested here
bool __z_inf = std::__constexpr_isinf(__a) || std::__constexpr_isinf(__b);
^
/Users/runner/work/universal/universal/static/fixpnt/binary/complex/mod_complex_mul.cpp:74:18: note: in instantiation of function template specialization 'std::operator*<sw::universal::fixpnt<4, 0>>' requested here
result = a * b;
^
/Users/runner/work/universal/universal/static/fixpnt/binary/complex/mod_complex_mul.cpp:187:42: note: in instantiation of function template specialization 'VerifyComplexMultiplication<4UL, 0UL, true, unsigned char>' requested here
nrOfFailedTestCases += ReportTestResult(VerifyComplexMultiplication< 4, 0, Modulo, uint8_t>(reportTestCases), "fixpnt< 4, 0,Modulo,uint8_t>", test_tag);
^
/Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/math.h:429:87: note: candidate function not viable: no known conversion from 'sw::universal::fixpnt<4, 0>' to 'float' for 1st argument
_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT {
^
/Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/math.h:433:114: note: candidate function not viable: no known conversion from 'sw::universal::fixpnt<4, 0>' to 'double' for 1st argument
_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isinf(double __x) _NOEXCEPT {
^
/Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/math.h:437:87: note: candidate function not viable: no known conversion from 'sw::universal::fixpnt<4, 0>' to 'long double' for 1st argument
_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(long double __x) _NOEXCEPT {
^
/Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/math.h:417:80: note: candidate template ignored: requirement 'std::is_arithmetic<sw::universal::fixpnt<4, 0, true, unsigned char>>::value' was not satisfied [with _A1 = sw::universal::fixpnt<4, 0>]
_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1 __x) _NOEXCEPT {
^
/Applications/Xcode_15.0.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/math.h:424:5: note: candidate template ignored: requirement 'std::is_arithmetic<sw::universal::fixpnt<4, 0, true, unsigned char>>::value' was not satisfied [with _A1 = sw::universal::fixpnt<4, 0>]
isinf(_A1) _NOEXCEPT {
^
The failure to cast the fixpnt type to native IEEE floats would be difficult to solve as the design disables automatic conversions to avoid difficult to find numerical bug behavior.
However, the std::arithmetic<> error makes sense, but I would like to understand the design intent behind this, as this is the only C++ stack that throws this constraint.