[Bug libstdc++/105441] The floating point overload of from_chars ignores 'P' for hex format

hewillk at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Apr 30 17:35:48 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105441

--- Comment #1 from 康桓瑋 <hewillk at gmail dot com> ---
floating_from_chars.cc#L667

// Parse the written exponent.
int written_exponent = 0;
if (first != last && *first == 'p')
  {
    // Tentatively consume the 'p' and try to parse a decimal number.
    const char* const fallback_first = first;

it seems like it should be

if (first != last && std::tolower((unsigned char)*first) == 'p')


More information about the Gcc-bugs mailing list