summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/std/utilities/template.bitset/bitset.operators/stream_in.pass.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/template.bitset/bitset.operators/stream_in.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.operators/stream_in.pass.cpp
index 1cb92ea3458..0127b75160b 100644
--- a/libcxx/test/std/utilities/template.bitset/bitset.operators/stream_in.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/bitset.operators/stream_in.pass.cpp
@@ -25,6 +25,18 @@ int main(int, char**)
in >> b;
assert(b.to_ulong() == 0x5A);
}
+ {
+ // Make sure that input-streaming an empty bitset does not cause the
+ // failbit to be set (LWG 3199).
+ std::istringstream in("01011010");
+ std::bitset<0> b;
+ in >> b;
+ assert(b.to_string() == "");
+ assert(!in.bad());
+ assert(!in.fail());
+ assert(!in.eof());
+ assert(in.good());
+ }
#ifndef TEST_HAS_NO_EXCEPTIONS
{
std::stringbuf sb;
OpenPOWER on IntegriCloud