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: 189222 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp379227dyb; Thu, 18 Jan 2024 06:31:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1tjcZg6pBbY/etuRy5KYwrrgm8NrEBZ38BGVB2m7jDiDO/iVdklUDva32uKv42mX4gVp2 X-Received: by 2002:ac8:5dd1:0:b0:429:d345:afde with SMTP id e17-20020ac85dd1000000b00429d345afdemr863517qtx.58.1705588286162; Thu, 18 Jan 2024 06:31:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705588286; cv=pass; d=google.com; s=arc-20160816; b=rDMuAD3ICgLveVfEWMrP/4Zhg+f5CzFBn3lvjsEdW9Qk2I3MhYjycrggkQDJFyYVzc vj7/PC7IqbjbO0GDTs68Uhb2LMRc30qHPvspXM0u9yjOam5pq6tblkmQU1KXMU0lHb4s RZX5AhM+yBlLZhrOXZiTC7ra9XpO7l7GSksYGkJChHwFXlOk2urpvYnjBh0Jet/Fh+yk 4VoL85+8lzL3U1HJJhbYOfVpQhZSjTPh+h6KY8yBTLVgTBGvTgdreKX727rwKx6m3h5/ A3byG47kzTHMNHuaZFHYNEtu/q8g+nsk8HF0AQ+5jogF6xQQXtpCr4GBiSnteMEx5aWA BDHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=MvNOJG9uJuTQ+Op6JhvDlr9Ue46rhtZr7//tNvr11pY=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=Fh+WLEnxk5Q7O3FMAHaHwHtPTzkcXPCL7IyjqW8trQBsxO4U/eMRzjhHudtuYpC7Dy bojvy36bBHsiK9DpQlsBd5RPQLeEei0/Z1dr0/OyhYqlUkBxdVqVRZ7xDHJcNW2BcSrr GBiLVSeMV+4gE+A+BV7nFLCZmhII/sQJD7+b4dyNUEgL8y4GIKYqYTNFCHNl5ezeB3Ai ibrPCyknUQDCf4ei/oZExx+mfjIrRdTLWq0VdVDEXBctTVRjQPaOmfcE3wVP1CaFR1Br 564ljVNR6GOmtuUFN+nSVxPhl3LMRIIUkeCdUD2p5GydAbwTlRObzmJKo5qX0Nm+NXDP UMJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cfKx3pbm; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x6-20020a05622a000600b00429ffeb6f9esi5699874qtw.468.2024.01.18.06.31.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 06:31:26 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cfKx3pbm; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB3BF3861823 for ; Thu, 18 Jan 2024 12:57:36 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788438942793819650 X-GMAIL-MSGID: 1788438942793819650 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));