aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-05-25 10:32:33 +0100
committerJonathan Wakely <jwakely@redhat.com>2023-05-31 13:17:45 +0100
commit7037e7b6e4ac41e536bdb9a2efcf546ec4d77166 (patch)
tree810956f2111e861410879dd250d1186e5e441738 /gcc
parent979f8bfd3164d23e6bd192a00e89eb1fc8f5b4a3 (diff)
downloadgcc-7037e7b6e4ac41e536bdb9a2efcf546ec4d77166.zip
gcc-7037e7b6e4ac41e536bdb9a2efcf546ec4d77166.tar.gz
gcc-7037e7b6e4ac41e536bdb9a2efcf546ec4d77166.tar.bz2
libstdc++: Fix preprocessor conditions for std::from_chars [PR109921]
We use the from_chars_strtod function with __strtof128 to read a _Float128 value, but from_chars_strtod is not defined unless uselocale is available. This can lead to compilation failures for some targets, because we try to define the _Flaot128 overload in terms of a non-existing from_chars_strtod function. Only try to use __strtof128 if uselocale is available, otherwise fallback to the long double overload of std::from_chars (which might fallback to the double overload, which should use fast_float). This ensures we always define the full set of overloads, even if they are not always accurate for all values of the wider types. libstdc++-v3/ChangeLog: PR libstdc++/109921 * src/c++17/floating_from_chars.cc (USE_STRTOF128_FOR_FROM_CHARS): Only define when USE_STRTOD_FOR_FROM_CHARS is also defined. (USE_STRTOD_FOR_FROM_CHARS): Do not undefine when long double is binary64. (from_chars(const char*, const char*, double&, chars_format)): Check __LDBL_MANT_DIG__ == __DBL_MANT_DIG__ here. (from_chars(const char*, const char*, _Float128&, chars_format)) Only use from_chars_strtod when USE_STRTOD_FOR_FROM_CHARS is defined, otherwise parse a long double and convert to _Float128.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions