diff options
Diffstat (limited to 'libcxx/test/support/charconv_test_helpers.h')
-rw-r--r-- | libcxx/test/support/charconv_test_helpers.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libcxx/test/support/charconv_test_helpers.h b/libcxx/test/support/charconv_test_helpers.h index dc704a925a3..f30956e9a73 100644 --- a/libcxx/test/support/charconv_test_helpers.h +++ b/libcxx/test/support/charconv_test_helpers.h @@ -17,8 +17,8 @@ #include "test_macros.h" -#if TEST_STD_VER <= 11 -#error This file requires C++14 +#if TEST_STD_VER < 11 +#error This file requires C++11 #endif using std::false_type; @@ -56,14 +56,14 @@ template <typename X, typename T, typename xl = std::numeric_limits<X>> constexpr bool _fits_in(T v, false_type, true_type /* T signed */, false_type /* X unsigned*/) { - return 0 <= v && std::make_unsigned_t<T>(v) <= (xl::max)(); + return 0 <= v && typename std::make_unsigned<T>::type(v) <= (xl::max)(); } template <typename X, typename T, typename xl = std::numeric_limits<X>> constexpr bool _fits_in(T v, false_type, false_type /* T unsigned */, ...) { - return v <= std::make_unsigned_t<X>((xl::max)()); + return v <= typename std::make_unsigned<X>::type((xl::max)()); } template <typename X, typename T> @@ -119,7 +119,7 @@ struct to_chars_test_base } private: - static auto fromchars(char const* p, char const* ep, int base, true_type) + static long long fromchars(char const* p, char const* ep, int base, true_type) { char* last; auto r = strtoll(p, &last, base); @@ -128,7 +128,7 @@ private: return r; } - static auto fromchars(char const* p, char const* ep, int base, false_type) + static unsigned long long fromchars(char const* p, char const* ep, int base, false_type) { char* last; auto r = strtoull(p, &last, base); @@ -138,6 +138,7 @@ private: } static auto fromchars(char const* p, char const* ep, int base = 10) + -> decltype(fromchars(p, ep, base, std::is_signed<X>())) { return fromchars(p, ep, base, std::is_signed<X>()); } |