From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id D9BFD3858420; Thu, 18 Jan 2024 21:03:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9BFD3858420 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705611805; bh=ZKi6pR3Ci7xYbqdy2XcjsmOCrkiZeHd3RSfkn8yv14o=; h=From:To:Subject:Date:From; b=TfYcSZvtolfrS12ueQNaWesIi8GUvl6r8xBXzsJRBErYvdIcwP0DKdt1HBH5KKf10 OFcIibXG0buCGHqvgfE/kyRQM8ep1MhhhuDGS2mw6g3GaWh/6lF8yu/HLKybdNCHMv xSv/8qwXJvr9lkkxp8dWRT13qcrW05Gy3GX5RjbM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-8238] libstdc++: Fix std::format test for Solaris [PR113450] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-13 X-Git-Oldrev: 35000c65470792aed3a3c23a3b3fc45db4bec2c4 X-Git-Newrev: 5240df78a07303a37b1f0b83165624d2a648089e Message-Id: <20240118210325.D9BFD3858420@sourceware.org> Date: Thu, 18 Jan 2024 21:03:25 +0000 (GMT) List-Id: https://gcc.gnu.org/g:5240df78a07303a37b1f0b83165624d2a648089e commit r13-8238-g5240df78a07303a37b1f0b83165624d2a648089e Author: Jonathan Wakely Date: Wed Jan 17 21:40:25 2024 +0000 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: --- libstdc++-v3/testsuite/std/format/functions/format.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/std/format/functions/format.cc b/libstdc++-v3/testsuite/std/format/functions/format.cc index e9827d0b735..6c32100d0f8 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));