aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src/std/path.d
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2022-04-21 12:11:01 -0400
committerPatrick Palka <ppalka@redhat.com>2022-04-21 12:11:01 -0400
commit93dd7f36f2066ec52137178ee52052f293e5e743 (patch)
tree391af3af100b83dfca4c6b38fdb1d3d1f39befda /libphobos/src/std/path.d
parent605a80bb733b225e5e53db0f0298374213cdcd95 (diff)
downloadgcc-93dd7f36f2066ec52137178ee52052f293e5e743.zip
gcc-93dd7f36f2066ec52137178ee52052f293e5e743.tar.gz
gcc-93dd7f36f2066ec52137178ee52052f293e5e743.tar.bz2
libstdc++: Avoid ASCII assumptions in floating_from_chars.cc
In starts_with_ci and in __floating_from_chars_hex's inf/nan handling, we were assuming that the letters are contiguous and that 'A' + 32 == 'a' which is true for ASCII but not for other character encodings. This patch fixes starts_with_ci by using a constexpr lookup table that maps uppercase letters to lowercase, and fixes __floating_from_chars_hex by using __from_chars_alnum_to_val. libstdc++-v3/ChangeLog: * include/std/charconv (__from_chars_alnum_to_val_table): Simplify initialization of __lower/__upper_letters. (__from_chars_alnum_to_val): Default the template parameter to false. * src/c++17/floating_from_chars.cc (starts_with_ci): Don't assume the uppercase and lowercase letters are contiguous. (__floating_from_chars_hex): Likewise.
Diffstat (limited to 'libphobos/src/std/path.d')
0 files changed, 0 insertions, 0 deletions