]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Don't call 4-5 argument to_chars with chars_format{}
authorJakub Jelinek <jakub@redhat.com>
Wed, 21 Dec 2022 08:04:06 +0000 (09:04 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 21 Dec 2022 08:04:06 +0000 (09:04 +0100)
commit3102b57f3105a301e54d7dc0586eb8e2b1724891
treeaf1e5e2f4ddba0802b76d01374c9096bca48501c
parent18fc70aa9c753d17c00211cea9fa5bd843fe94fd
libstdc++: Don't call 4-5 argument to_chars with chars_format{}

In Fedora build libstdc++.so is built with assertions enabled and
FAIL: 20_util/to_chars/float128_c++23.cc execution test
was failing on all arches.  The problem is that it called 5 argument version
of to_chars with chars_format{}, which C++ says is invalid:
http://eel.is/c++draft/charconv.to.chars#12
Preconditions: fmt has the value of one of the enumerators of chars_format.

The following patch fixes it by skipping the second part of the test
which needs the 5 argument to_chars for chars_format{}, but because
it is strictly speaking invalid also for 4 argument to_chars, it uses
3 argument to_chars instead of 4 argument to_chars with last argument
chars_format{}.

2022-12-21  Jakub Jelinek  <jakub@redhat.com>

* testsuite/20_util/to_chars/float16_c++23.cc (test): Use 3 argument
std::to_chars if fmt is std::chars_format{}, rather than 4 argument.
* testsuite/20_util/to_chars/float128_c++23.cc (test): Likewise, and
skip second part of testing that requires 5 argument std::to_chars.
libstdc++-v3/testsuite/20_util/to_chars/float128_c++23.cc
libstdc++-v3/testsuite/20_util/to_chars/float16_c++23.cc