From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 2AB9B396D83B; Wed, 16 Nov 2022 20:59:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AB9B396D83B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668632367; bh=Bt34XJM7JKzC9APSjXwJS6KAMwT+MzSKAb//hA02CyY=; h=From:To:Subject:Date:From; b=pDJgrQQ97VU7RJPk0UguKBfxV8kjC57OL6AMn+JZRvLmIKolB1r49uTkMd9V+4RUl GeCEhZJ2q9fbT7Is6t9a97o9IcRE/j2Rghx44ZTda+1edNpufBf40j8p6eni5p7Mr+ SpxgpfpBDeV7RS24PBS0paMNFejRcvXBxbY2gRyw= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-4108] libstdc++: Disable std::format of _Float128 if std::to_chars is innaccurate X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 96e4244ef3ccf4867ca4e37fbc6800e64ef30af6 X-Git-Newrev: 22cb0fea718fd4dab8c97c8f03054a2fb7dc3d76 Message-Id: <20221116205927.2AB9B396D83B@sourceware.org> Date: Wed, 16 Nov 2022 20:59:27 +0000 (GMT) List-Id: https://gcc.gnu.org/g:22cb0fea718fd4dab8c97c8f03054a2fb7dc3d76 commit r13-4108-g22cb0fea718fd4dab8c97c8f03054a2fb7dc3d76 Author: Jonathan Wakely Date: Tue Nov 15 15:31:17 2022 +0000 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. Diff: --- libstdc++-v3/include/std/format | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 204a1710aca..fb29f7e7835 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