[PATCH] libstdc++-v3: Some std::*float*_t charconv and i/ostream overloads

Jonathan Wakely jwakely@redhat.com
Tue Nov 1 12:18:18 GMT 2022


On Wed, 19 Oct 2022 at 13:59, Jakub Jelinek <jakub@redhat.com> wrote:
>
> Hi!
>
> The following patch adds the easy part of <charconv>, <istream> and
> <ostream> changes for extended floats.
> In particular, for the first one only overloads where the _Float* has
> the same format as float/double/long double and for the latter two
> everything but the _GLIBCXX_HAVE_FLOAT128_MATH case.
> For charconv, I'm not really familiar with it, I'm pretty sure
> we need new libstdc++.so.6 side implementation of from_chars for
> {,b}float16_t and for to_chars not really sure but for unspecified precision
> if it should emit minimum characters that to_chars then can unambiguously
> parse, I think it is less than in the float case.  For float128_t
> {to,from}_chars I think we even have it on the library side already, just
> ifdefed for powerpc64le only.
> For i/o stream operator<</>>, not sure what is better, if not providing
> anything at all, or doing what we in the end do if user doesn't override
> the virtual functions, or use {to,from}_chars under the hood, something
> else?
> Besides this, the patch adds some further missed
> // { dg-options "-std=gnu++2b" }
> spots, I've also noticed I got the formatting wrong in some testcases
> by not using spaces around VERIFY conditions and elsewhere by having
> space before ( for calls.
> The testsuite coverage is limited, I've added test for from_chars because
> it was easy to port, but not really sure what to do about to_chars, it has
> for float/double huge testcases which would be excessive to repeat.
> And for i/ostream not really sure what exactly is worth testing.
>
> Tested on x86_64-linux with --target_board=unix/-std=gnu++23, ok for trunk?
>

OK, thanks!



More information about the Libstdc++ mailing list