From patchwork Thu Jan 18 12:54:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 84340 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DE353386101E for ; Thu, 18 Jan 2024 12:57:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 688C3385C424 for ; Thu, 18 Jan 2024 12:54:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 688C3385C424 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 688C3385C424 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705582498; cv=none; b=CERwpDmHROV3tJ6gbZuOWwpMKJPw60ew7rKChr/4DPKUCv288iyodreDXSLMeJTRlcbooL2DE7yxHJ2ywsUrIBM/1uS7I4wAFZnE4/XleSk0FU/p3O3jtIiQWFAWk3KoiKZAR+STWJVixMZEwyTQoFYbfwN1VF7gekjpXgbmGWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705582498; c=relaxed/simple; bh=6++ZxdhZCrOPKsnUOgzeqUE+lNOkwLYORN1Z/Mdjeg4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vuaNJUqGVLeALtkJYx/ShjoibzYiihRHcYqr6dEL7aFEYigN43ZWjeOrEBafRmuvY4QK3NPMq12miBZk7DEwUW+ccPakN2RYlnmR2lGUuMR/BOUTphU2LWuIwSRN2rKT/s9LbtqFapp0Kvp9Yy3dJdylyV8w8ZutE2JY5IRORYA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705582497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MvNOJG9uJuTQ+Op6JhvDlr9Ue46rhtZr7//tNvr11pY=; b=cfKx3pbmnZIsZolnPgVjXC8JDtQxBnXdt/UCCjlrk2P87E6HuQV6IdYUVF8Z5fefjSIZUT Gzz7i++XsgWAAvfx6ZqIWDFDKEGCIoxv6Jh9Ki74+1WnodxlROrPfQwj30cjhGbt+6N3Hk umFLmDeYGj273YXwfZJQzBfBCvq+DtY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-2-rVUpDSEjPa2sdOYyzpOWOA-1; Thu, 18 Jan 2024 07:54:53 -0500 X-MC-Unique: rVUpDSEjPa2sdOYyzpOWOA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A482B38149B5; Thu, 18 Jan 2024 12:54:53 +0000 (UTC) Received: from localhost (unknown [10.42.28.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F0902022C38; Thu, 18 Jan 2024 12:54:53 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix std::format test for Solaris [PR113450] Date: Thu, 18 Jan 2024 12:54:26 +0000 Message-ID: <20240118125452.100945-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Tested x86_64-linux. Pushed to trunk. -- >8 -- 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. --- 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 63702edbd42..30c5fc22237 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::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));