File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1212#include < __cxx03/__config>
1313#include < __cxx03/__type_traits/enable_if.h>
1414#include < __cxx03/__type_traits/is_arithmetic.h>
15- #include < __cxx03/__type_traits/is_floating_point.h>
1615#include < __cxx03/__type_traits/is_integral.h>
1716#include < __cxx03/__type_traits/is_signed.h>
1817#include < __cxx03/__type_traits/promote.h>
@@ -28,8 +27,21 @@ namespace __math {
2827
2928// signbit
3029
31- template <class _A1 , __enable_if_t <is_floating_point<_A1>::value, int > = 0 >
32- _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool signbit (_A1 __x) _NOEXCEPT {
30+ // The universal C runtime (UCRT) in the WinSDK provides floating point overloads
31+ // for std::signbit(). By defining our overloads as templates, we can work around
32+ // this issue as templates are less preferred than non-template functions.
33+ template <class = void >
34+ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool signbit (float __x) _NOEXCEPT {
35+ return __builtin_signbit (__x);
36+ }
37+
38+ template <class = void >
39+ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool signbit (double __x) _NOEXCEPT {
40+ return __builtin_signbit (__x);
41+ }
42+
43+ template <class = void >
44+ _LIBCPP_NODISCARD inline _LIBCPP_HIDE_FROM_ABI bool signbit (long double __x) _NOEXCEPT {
3345 return __builtin_signbit (__x);
3446}
3547
Original file line number Diff line number Diff line change 1717// GCC warns about signbit comparing `bool_v < 0`, which we're testing
1818// ADDITIONAL_COMPILE_FLAGS(gcc): -Wno-bool-compare
1919
20- // XFAIL: FROZEN-CXX03-HEADERS-FIXME
21-
2220#include < cassert>
2321#include < cmath>
2422#include < limits>
You can’t perform that action at this time.
0 commit comments