From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664571440; 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=2idHArwR4/pg8LM5qKN+QYjsWGbz2G36lmbh88fQOFU=; b=FbvUCb2hZVg8wdE+8dRrIohLxIR4PRPErq8PYu/Esc1VfS+FtWtEYeAPQuRbmGg0wgjpwK HtWCxUJF50PyFwJSwyNLQSayKwYZITKmNk60RVO98vGm1T2ZEXlNbqPdfr0CDQgOW146Fr 4YTXfzva9PQ1kvZ99O9YTYqklGdJ2qU= 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) From: Jonathan Wakely 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 Content-Type: text/plain Content-Transfer-Encoding: 8bit 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 List-Id: 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 ); } -- 2.37.3