aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-09-30 15:54:19 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-09-30 21:52:02 +0100
commit789ddef1cf5a906802f61b2c494a86b80489f2e5 (patch)
tree99da9b8b170fa648e9842adddb9696dcf59e1d93 /libstdc++-v3
parent1c12a3cfdfabf67c7962ee6532e001e4d48e7fc2 (diff)
downloadgcc-789ddef1cf5a906802f61b2c494a86b80489f2e5.zip
gcc-789ddef1cf5a906802f61b2c494a86b80489f2e5.tar.gz
gcc-789ddef1cf5a906802f61b2c494a86b80489f2e5.tar.bz2
libstdc++: Remove <sstream> 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.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/testsuite/20_util/bitset/access/to_ulong.cc13
1 files changed, 1 insertions, 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 8163701..edc021c 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 <bitset>
-#include <stdexcept>
-#include <sstream>
#include <testsuite_hooks.h>
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 );
}