]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Allow std::to_chars for 128-bit integers in strict mode
authorJonathan Wakely <jwakely@redhat.com>
Tue, 1 Nov 2022 09:48:41 +0000 (09:48 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Sun, 13 Nov 2022 01:10:44 +0000 (01:10 +0000)
commitd4ba3b369cbe9bce0a1212670825ecfb99762520
tree5ba9b0ae3ec94f3bfe938ad9435b1914b6ea0de6
parent7ce0cee77adf33397d0ba61e7445effd8a5d8fcc
libstdc++: Allow std::to_chars for 128-bit integers in strict mode

This allows std::format to support __int128 when __STRICT_ANSI__ is
defined, which previously failed because __int128 is not an integral
type in strict mode.

With these changes, std::to_chars still rejects 128-bit integers in
strict mode, but std::format will be able to use __detail::__to_chars_i
for unsigned __int128.

libstdc++-v3/ChangeLog:

* include/bits/charconv.h (__integer_to_chars_is_unsigned):
New variable template.
(__to_chars_len, __to_chars_10_impl): Use variable template in
assertions to allow unsigned __int128 in strict mode.
* include/std/charconv (__to_chars, __to_chars_16)
(__to_chars_10, __to_chars_8, __to_chars_2): Likewise.
libstdc++-v3/include/bits/charconv.h
libstdc++-v3/include/std/charconv