diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv index 4337a9e52f9b..a3f8c7718b21 100644 --- a/libstdc++-v3/include/std/charconv +++ b/libstdc++-v3/include/std/charconv @@ -39,7 +39,6 @@ #include #include // for __bit_width -#include // for isdigit #include // for __to_chars_len, __to_chars_10_impl #include // for std::errc #include @@ -466,7 +465,7 @@ namespace __detail return true; } - constexpr unsigned char + constexpr char __from_chars_alpha_to_num(char __c) { switch (__c) @@ -550,10 +549,10 @@ namespace __detail case 'Z': return 35; } - return __gnu_cxx::__int_traits::__max; + return 127; } - /// std::from_chars implementation for integers in bases 11 to 26. + /// std::from_chars implementation for integers in bases 11 to 36. template bool __from_chars_alnum(const char*& __first, const char* __last, _Tp& __val, @@ -562,8 +561,8 @@ namespace __detail bool __valid = true; while (__first != __last) { - unsigned char __c = *__first; - if (std::isdigit(__c)) + char __c = *__first; + if ('0' <= __c && __c <= '9') // isdigit __c -= '0'; else {