diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-01-17 21:40:25 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2024-01-18 12:43:31 +0000 |
commit | db42a0a98916340af33338c08e6a7d328121b958 (patch) | |
tree | bf428d4a6db7d036df9b4db36f3e935f9127ab6a | |
parent | 1c1853a70f9422169190e65e568dcccbce02d95c (diff) | |
download | gcc-db42a0a98916340af33338c08e6a7d328121b958.zip gcc-db42a0a98916340af33338c08e6a7d328121b958.tar.gz gcc-db42a0a98916340af33338c08e6a7d328121b958.tar.bz2 |
libstdc++: Fix std::format test for Solaris [PR113450]
When int8_t is a typedef for char (rather than signed char) this test
fails because it tries to format a char, which is treated differently
from formatting other integral types (including signed char).
Use signed char explicitly so the result doesn't depend on the
non-portable definition of int8_t.
libstdc++-v3/ChangeLog:
PR libstdc++/113450
* testsuite/std/format/functions/format.cc: Use signed char
instead of int8_t.
-rw-r--r-- | libstdc++-v3/testsuite/std/format/functions/format.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/std/format/functions/format.cc b/libstdc++-v3/testsuite/std/format/functions/format.cc index 63702ed..30c5fc2 100644 --- a/libstdc++-v3/testsuite/std/format/functions/format.cc +++ b/libstdc++-v3/testsuite/std/format/functions/format.cc @@ -365,7 +365,7 @@ test_minmax() s = std::format("{:b}" , std::numeric_limits<U>::max()); VERIFY( s == '1' + ones ); }; - check(std::int8_t(0)); + check((signed char)(0)); // int8_t is char on Solaris, see PR 113450 check(std::int16_t(0)); check(std::int32_t(0)); check(std::int64_t(0)); |