Before this patch, we would only ever throw an exception if the badbit
was set on the stream. The Standard is currently very unclear on how
exceptions should be propagated and what error flags should be set by
the input stream operations. This commit changes libc++ to behave under
a different (but valid) interpretation of the Standard. This interpretation
of the Standard matches what other implementations are doing.
I will submit a paper in San Diego to clarify the Standard such that the
interpretation used in this commit (and other implementations) is the only
possible one.
https://bugs.llvm.org/show_bug.cgi?id=21586
https://bugs.llvm.org/show_bug.cgi?id=15949
rdar://problem/15347558
I like auto just FYI :)