Index: libcxx/trunk/include/istream =================================================================== --- libcxx/trunk/include/istream +++ libcxx/trunk/include/istream @@ -1619,7 +1619,7 @@ __is.rdbuf()->sbumpc(); } __x = bitset<_Size>(__str); - if (__c == 0) + if (_Size > 0 && __c == 0) __state |= ios_base::failbit; #ifndef _LIBCPP_NO_EXCEPTIONS } Index: libcxx/trunk/test/std/utilities/template.bitset/bitset.operators/stream_in.pass.cpp =================================================================== --- libcxx/trunk/test/std/utilities/template.bitset/bitset.operators/stream_in.pass.cpp +++ libcxx/trunk/test/std/utilities/template.bitset/bitset.operators/stream_in.pass.cpp @@ -25,6 +25,18 @@ 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; Index: libcxx/trunk/www/upcoming_meeting.html =================================================================== --- libcxx/trunk/www/upcoming_meeting.html +++ libcxx/trunk/www/upcoming_meeting.html @@ -71,7 +71,7 @@