aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-11-15 15:31:17 +0000
committerJonathan Wakely <jwakely@redhat.com>2022-11-16 20:52:03 +0000
commit22cb0fea718fd4dab8c97c8f03054a2fb7dc3d76 (patch)
tree0c616f94853efe0f401de8913535f27b89afd3d4 /libstdc++-v3
parent96e4244ef3ccf4867ca4e37fbc6800e64ef30af6 (diff)
downloadgcc-22cb0fea718fd4dab8c97c8f03054a2fb7dc3d76.zip
gcc-22cb0fea718fd4dab8c97c8f03054a2fb7dc3d76.tar.gz
gcc-22cb0fea718fd4dab8c97c8f03054a2fb7dc3d76.tar.bz2
libstdc++: Disable std::format of _Float128 if std::to_chars is innaccurate
This restricts std::format support for _Float128 (and __float128) to targets where glibc provides __strfromf128 and so can give correct output. libstdc++-v3/ChangeLog: * include/std/format [__FLT128_DIG__] (_GLIBCXX_FORMAT_F128): Only support formatting _Float128 when glibc provides the functionality needed for accurate std::to_chars.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/include/std/format4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format
index 204a171..fb29f7e 100644
--- a/libstdc++-v3/include/std/format
+++ b/libstdc++-v3/include/std/format
@@ -1235,13 +1235,13 @@ namespace __format
using __float128_t = long double;
# define _GLIBCXX_FORMAT_F128 1
-#elif __FLT128_DIG__ && defined(__GLIBC_PREREQ) // see floating_to_chars.cc
+#elif __FLT128_DIG__ && defined(_GLIBCXX_HAVE_FLOAT128_MATH)
// Format 128-bit floating-point types using _Float128.
using __float128_t = _Float128;
# define _GLIBCXX_FORMAT_F128 2
-# if __cplusplus == 202002L || !defined(_GLIBCXX_HAVE_FLOAT128_MATH)
+# if __cplusplus == 202002L
// These overloads exist in the library, but are not declared for C++20.
// Make them available as std::__format::to_chars.
to_chars_result