From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id AFCF03858D28; Fri, 6 Jan 2023 13:25:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AFCF03858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673011543; bh=txO5Ybi1MHERk2fpMnRU+A5vn07MA/FXVebYyatQBjI=; h=From:To:Subject:Date:From; b=C7+9lJrf0uMYnZlSXt0+9bRdv88A1JRnX5xA1aoBCHieEoJygYendkRd1LGJSVZVt MzRmy0RpzwxuGfS0H/3GhrYz8e6ImS9/WY8SVoQRy2oeFfMw10h/fUmuocO1Niz1C6 buuaax2RPT+OteRqSeaDLFFjDoGArPzD8q95BWAg= 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-5047] libstdc++: Disable broken std::format for floating-point types [PR108221] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: a40c22c377c7cc657b0feaf0119d84d0d142a318 X-Git-Newrev: 8c330fd49464f3d47a7c171d767eb3a011add76b Message-Id: <20230106132543.AFCF03858D28@sourceware.org> Date: Fri, 6 Jan 2023 13:25:43 +0000 (GMT) List-Id: https://gcc.gnu.org/g:8c330fd49464f3d47a7c171d767eb3a011add76b commit r13-5047-g8c330fd49464f3d47a7c171d767eb3a011add76b Author: Jonathan Wakely Date: Thu Jan 5 14:04:32 2023 +0000 libstdc++: Disable broken std::format for floating-point types [PR108221] If we don't have std::to_chars for floating-point types (either because float and double are not IEEE format, or size_t is 16-bit) then we can't use them with std::format. This causes a bootstrap failure since std/c++20/tzdb.cc was added to the library, because now includes . This change just disables formatting support for those types. This is not a proper fix, but solves the bootstrap failure for now. libstdc++-v3/ChangeLog: PR libstdc++/108221 * include/std/format (basic_format_arg) [!__cpp_lib_to_chars]: Disable visiting floating-point types. Diff: --- libstdc++-v3/include/std/format | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index 98421e8c123..77f7c9fef3f 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -3034,6 +3034,7 @@ namespace __format return std::forward<_Visitor>(__vis)(_M_val._M_ll); case _Arg_ull: return std::forward<_Visitor>(__vis)(_M_val._M_ull); +#if __cpp_lib_to_chars // FIXME: need to be able to format these types! case _Arg_flt: return std::forward<_Visitor>(__vis)(_M_val._M_flt); case _Arg_dbl: @@ -3046,6 +3047,7 @@ namespace __format return std::forward<_Visitor>(__vis)(_M_val._M_f128); case _Arg_ibm128: return std::forward<_Visitor>(__vis)(_M_val._M_ibm128); +#endif #endif case _Arg_str: return std::forward<_Visitor>(__vis)(_M_val._M_str);