From patchwork Fri Sep 30 20:57:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1614 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp668275wrs; Fri, 30 Sep 2022 14:00:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM557u0iLFWTXuNBJhAl5bO5YChZ8eRrzbvbQFbplLtqjZCk+HLuUJveW5Bt35+pEEcNjUHK X-Received: by 2002:a50:9344:0:b0:448:ce76:7c81 with SMTP id n4-20020a509344000000b00448ce767c81mr9337118eda.187.1664571629858; Fri, 30 Sep 2022 14:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664571629; cv=none; d=google.com; s=arc-20160816; b=pOtmbj+Le5zVn1dS/qwmYLssR4YpNchc4FPAXcOGedAEA53N40CR3i137lNDulAoly lVNo6jcpbw28AEg/G1bgDJLGFhUF4o9qGZQteiBjLxSG+5NZ5blUnyyNG9XTIgdF+wrr 8EDSGrGaFcqCbQbzrUfExqoKui7gQhu2wWNhnMRbGPSFSaUtfvDscwglmjg3XG2hV76f pxUDpKEWr8Nuao7W29mnph+n0Je43H8MQ7kuFENNc+mY9185/HbZHMwT1A2xaf9sYnJ1 PojrSuK5zx4MKXKkr8ekxu1WWrq5Q6axnA7c9ShLVvrMxA7Uk0tgBL9UgiD+JXOsiYcQ Xa5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=2idHArwR4/pg8LM5qKN+QYjsWGbz2G36lmbh88fQOFU=; b=BikYsll3XwEIwxQMyBAFkWcglxklk3RgpmDfYZuasWDzF3XJbW1Yk8Rtt3STJBgORi 4ohc2NqhPB3FcBwp/bYxcC4dbCA5RiuLMu1SPmmebZ3wUZz4gkn/ywBupBNPaKh+7h68 ebRs1jzpud9YkRtiqmdnVl2/1IpMGsO38X7jVVm0HEgx0WLrSocXYvm8yhIEew7da637 YJlcOpAYElfEMqud5F5bO5wFNqEUv53bh6A8pqLRXYJ3dVNjwU8C9QtfikV0LR1l+mCS ya+4Rv/3lID9/2/ueUp9cRbscIcJq4wIkbpS/o/2SDuzkIVs1cdcd35IoJZo8ajQVH7C INjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="MI/qfz16"; 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=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dm10-20020a170907948a00b007418a1e877dsi2172924ejc.580.2022.09.30.14.00.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 14:00:29 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b="MI/qfz16"; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 564AE3850850 for ; Fri, 30 Sep 2022 20:59:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 564AE3850850 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664571564; bh=2idHArwR4/pg8LM5qKN+QYjsWGbz2G36lmbh88fQOFU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=MI/qfz16G5bKSDj1nmbEQ/5ULaK2W2JCywhmVKPlzp+wZKJQL5ypu5TSjLca8D6Hk JYDLNposb7Tv3+0muJLzVx9qI0vYFsFpEb4EeQ0f+VcoBq2qJF8EVKFSYAGZLaoynL JBz+LM/AUUaJjQzXrkwwT+OxPDxW+aHC/qva96dI= 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 7D161385701C for ; Fri, 30 Sep 2022 20:57:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D161385701C Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-260-oYrxEEHONuqyDpKbfSxHTw-1; Fri, 30 Sep 2022 16:57:18 -0400 X-MC-Unique: oYrxEEHONuqyDpKbfSxHTw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A15891C09C90; Fri, 30 Sep 2022 20:57:18 +0000 (UTC) Received: from localhost (unknown [10.33.36.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 698C540C6EC2; Fri, 30 Sep 2022 20:57:18 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Remove dependency from std::bitset::to_ulong() test Date: Fri, 30 Sep 2022 21:57:17 +0100 Message-Id: <20220930205717.170362-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.5 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, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1745429861080860780?= X-GMAIL-MSGID: =?utf-8?q?1745429861080860780?= Tested x86_64-linux. Pushed to trunk. -- >8 -- There's no need to use a stringstream to test the to_ulong() member. This will allow the test to be used in freestanding mode. libstdc++-v3/ChangeLog: * testsuite/20_util/bitset/access/to_ulong.cc: Construct bitset from binary literal instead of using stringstream. --- .../testsuite/20_util/bitset/access/to_ulong.cc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/bitset/access/to_ulong.cc b/libstdc++-v3/testsuite/20_util/bitset/access/to_ulong.cc index 8163701e342..edc021c209c 100644 --- a/libstdc++-v3/testsuite/20_util/bitset/access/to_ulong.cc +++ b/libstdc++-v3/testsuite/20_util/bitset/access/to_ulong.cc @@ -20,22 +20,11 @@ // 23.3.5.2 bitset members #include -#include -#include #include void test03() { - std::bitset<5> b; - std::stringstream ss("101"); - ss.exceptions(std::ios_base::eofbit); - - try - { - ss >> b; - } - catch (std::exception&) { } - + std::bitset<5> b(0b101); VERIFY( b.to_ulong() == 5 ); }