From fc4486c2472b84384d4a31d2436a91bdb9b29792 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Tue, 20 Aug 2019 18:21:06 +0000 Subject: [libc++] Implement LWG 3199 Summary: The resolution of LWG 3199 makes sure that input-streaming into an empty bitset does not set the failbit on the input stream. Reviewers: mclow.lists, EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D65105 llvm-svn: 369422 --- libcxx/include/istream | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcxx/include') diff --git a/libcxx/include/istream b/libcxx/include/istream index d6217bbb800..bfbe5f24728 100644 --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -1619,7 +1619,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x) __is.rdbuf()->sbumpc(); } __x = bitset<_Size>(__str); - if (__c == 0) + if (_Size > 0 && __c == 0) __state |= ios_base::failbit; #ifndef _LIBCPP_NO_EXCEPTIONS } -- cgit v1.2.3