From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 2EB3238582B0; Fri, 30 Sep 2022 20:57:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EB3238582B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664571422; bh=AlyODtrCrKXAxPjEF/YA5u+Za7P6/H2RO/bLIFjkKW0=; h=From:To:Subject:Date:From; b=IuvYVQhlnEHujVYGJSabk+RVwqRzR4yhPucf+fbWOwDqlvskhxkX4/x64trJ6ZDMH D41WRDQTSlXoGMk3M50Hb3SczymQixXwHM6L7+9JRz9jsny+pX4KbfOvgVRvoPBgXj 2GOCuknLrvsNZiXCAjzFIW/Tt2lfLgcdWFROB2Yk= 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-2999] libstdc++: Remove dependency from std::bitset::to_ulong() test X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 1c12a3cfdfabf67c7962ee6532e001e4d48e7fc2 X-Git-Newrev: 789ddef1cf5a906802f61b2c494a86b80489f2e5 Message-Id: <20220930205702.2EB3238582B0@sourceware.org> Date: Fri, 30 Sep 2022 20:57:01 +0000 (GMT) List-Id: https://gcc.gnu.org/g:789ddef1cf5a906802f61b2c494a86b80489f2e5 commit r13-2999-g789ddef1cf5a906802f61b2c494a86b80489f2e5 Author: Jonathan Wakely Date: Fri Sep 30 15:54:19 2022 +0100 libstdc++: Remove dependency from std::bitset::to_ulong() test 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. Diff: --- libstdc++-v3/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 ); }