llvm-project/libcxx/test/std/utilities
Louis Dionne 396145d0da [libc++] Fix error flags and exceptions propagated from input stream operations
Summary:
This is a re-application of r357533 and r357531. They had been reverted
because we thought the commits broke the LLDB data formatters, but it
turns out this was because only r357531 had been included in the CI
run.

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.

This effectively implements the wording in p1264r0. It hasn't been voted
into the Standard yet, however there is wide agreement that the fix is
correct and it's just a matter of time before the fix is standardized.

PR21586
PR15949
rdar://problem/15347558

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D49863

llvm-svn: 357775
2019-04-05 16:33:37 +00:00
..
allocator.adaptor [libc++] Use UNSUPPORTED instead of TEST_STD_VER #ifdef 2019-02-05 19:50:17 +00:00
any [libc++] Mark bad_any_cast tests as unsupported when the dylib doesn't support bad_any_cast 2019-03-21 15:37:11 +00:00
charconv Mark <charconv> tests as unsupported for C++11 and C++14 if you're not testing libc++. Thanks to Louis for the suggestion. 2019-03-20 19:43:22 +00:00
function.objects [libc++] Use std::is_nothrow_callable for std::invoke according to LWG 2807 2019-04-03 17:54:37 +00:00
intseq Support tests in freestanding 2019-02-04 20:31:13 +00:00
memory [libc++] Remove unnecessary <iostream> #includes in tests 2019-03-28 16:38:15 +00:00
meta [libc++][NFC] Rename test file according to the libc++ convention 2019-04-03 14:38:28 +00:00
optional Cleaup of requirements for optional. While researching LWG3196, I realized that optional did not reject 'const in_place_t' like it should. Added a test as well, and a check for arrays (which were already disallowed, but now we get a better error message). Should not affect anyone's code. 2019-03-25 16:35:59 +00:00
ratio Support tests in freestanding 2019-02-04 20:31:13 +00:00
smartptr/unique.ptr [libc++] Enable deprecation warnings by default 2019-03-12 20:10:06 +00:00
template.bitset [libc++] Fix error flags and exceptions propagated from input stream operations 2019-04-05 16:33:37 +00:00
time Fix PR41130 - 'operator/ of std::chrono::duration and custom type'. Thanks to Zulan for the report, and Howard for the direction of the fix. 2019-04-01 16:38:02 +00:00
tuple [libc++] Declare std::tuple_element as struct instead of class 2019-04-01 16:39:34 +00:00
type.index Support tests in freestanding 2019-02-04 20:31:13 +00:00
utilities.general Support tests in freestanding 2019-02-04 20:31:13 +00:00
utility Support tests in freestanding 2019-02-04 20:31:13 +00:00
utility.requirements Support tests in freestanding 2019-02-04 20:31:13 +00:00
variant [libc++] Fix XFAILs when exceptions are disabled 2019-02-05 20:55:23 +00:00
nothing_to_do.pass.cpp Support tests in freestanding 2019-02-04 20:31:13 +00:00