From: Jonathan Wakely Date: Wed, 17 Jan 2024 21:40:25 +0000 (+0000) Subject: libstdc++: Fix std::format test for Solaris [PR113450] X-Git-Tag: releases/gcc-13.3.0~543 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5240df78a07303a37b1f0b83165624d2a648089e;p=thirdparty%2Fgcc.git 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. (cherry picked from commit db42a0a98916340af33338c08e6a7d328121b958) --- diff --git a/libstdc++-v3/testsuite/std/format/functions/format.cc b/libstdc++-v3/testsuite/std/format/functions/format.cc index e9827d0b7357..6c32100d0f86 100644 --- a/libstdc++-v3/testsuite/std/format/functions/format.cc +++ b/libstdc++-v3/testsuite/std/format/functions/format.cc @@ -351,7 +351,7 @@ test_minmax() s = std::format("{:b}" , std::numeric_limits::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));