public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-5047] libstdc++: Disable broken std::format for floating-point types [PR108221]
@ 2023-01-06 13:25 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-01-06 13:25 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:8c330fd49464f3d47a7c171d767eb3a011add76b

commit r13-5047-g8c330fd49464f3d47a7c171d767eb3a011add76b
Author: Jonathan Wakely <jwakely@redhat.com>
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 <chrono> now
    includes <format>.
    
    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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-06 13:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06 13:25 [gcc r13-5047] libstdc++: Disable broken std::format for floating-point types [PR108221] Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).