diff options
author | Louis Dionne <ldionne@apple.com> | 2019-08-20 18:21:06 +0000 |
---|---|---|
committer | Louis Dionne <ldionne@apple.com> | 2019-08-20 18:21:06 +0000 |
commit | fc4486c2472b84384d4a31d2436a91bdb9b29792 (patch) | |
tree | 3968eeafd4f5ce7c2e06a461c2992eddd89a0bb9 /libcxx/include | |
parent | 292b1087f408b020f6bfdfbc27ffa062e0bef0a8 (diff) | |
download | bcm5719-llvm-fc4486c2472b84384d4a31d2436a91bdb9b29792.tar.gz bcm5719-llvm-fc4486c2472b84384d4a31d2436a91bdb9b29792.zip |
[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
Diffstat (limited to 'libcxx/include')
-rw-r--r-- | libcxx/include/istream | 2 |
1 files changed, 1 insertions, 1 deletions
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 } |