llvm-project/libcxx/test/std
Eric Fiselier cb38f75e29 [libcxx] Mark most test/std/future tests as UNSUPPORTED in C++03
Summary:
This patch marks *most* tests for `std::promise`, `std::future` and `std::shared_future` as unsupported in C++03. These tests fail in C++03 mode because they attempt to copy a `std::future` even though it is a `MoveOnly` type. AFAIK the missing move-semantics in `std::future` is the only reason these tests fail but without move semantics these classes are useless. For example even though `std::promise::set_value` and `std::promise::set_exception(...)` work in C++03 `std::promise` is still useless because we cannot call `std::promise::get_future(...)`.

It might be possible to hack `std::move(...)` like we do for `std::unique_ptr` to make the move semantics work but I don't think it is worth the effort. Instead I think we should leave the `<future>` header as-is and mark the failing tests as `UNSUPPORTED`. I don't believe there are any users of `std::future` or `std::promise` in C++03 because they are so unusable. Therefore I am not concerned about losing test coverage and possibly breaking users. However because there are still parts of `<future>` that work in C++03 it would be wrong to `#ifdef` out the entire header.

@mclow.lists Should we take further steps to prevent the use of `std::promise`, `std::future` and `std::shared_future` in C++03?


Note: This patch also cleans up the tests and converts them to use `support/test_allocator.h` instead of a duplicate class in `test/std/futures/test_allocator.h`.

Reviewers: mclow.lists

Subscribers: vsk, mclow.lists, cfe-commits

Differential Revision: http://reviews.llvm.org/D12135

llvm-svn: 246271
2015-08-28 05:06:04 +00:00
..
algorithms Change some #ifdefs to #if - thanks to Dexon for thge catch. 2015-07-30 13:56:00 +00:00
atomics Misc drive-by cleanups. NFC 2015-08-24 21:20:07 +00:00
containers Recommit rL245802: Cleanup fancy pointer rebinding in list using __rebind_pointer. 2015-08-23 02:56:05 +00:00
depr Cleanup warnings in test/std/depr 2015-07-18 22:51:51 +00:00
diagnostics Fix warnings in array and assoc containers 2015-07-18 23:56:04 +00:00
experimental [libcxx] Add <experimental/any> v2. 2015-07-31 02:24:58 +00:00
extensions Fix more issues exposed by -pedantic-errors in c++03 mode 2015-02-10 17:20:18 +00:00
input.output Fix up typos in a couple of tests; due to agressive short-circuiting, they never failed on clang or gcc, but MSVC whined. Patch by Andrew Parker. 2015-07-18 18:24:15 +00:00
iterators A few bits of N2994 didn't get fully implemented a long time ago. Thanks to STL@microsoft.com for the bug report 2015-04-16 21:36:54 +00:00
language.support Fix a handful of tests that fail in C++03 2015-07-28 07:31:50 +00:00
localization Remove XFAIL in test. The bug causing it has been fixed. 2015-08-26 07:03:43 +00:00
numerics Remove unneeded initialisation of fenv_t and fexcept_t. 2015-03-15 18:36:31 +00:00
re Fix a crasher found by libFuzzer 2015-08-24 15:57:09 +00:00
strings implement more of N4258 - Cleaning up noexcept in the standard library. Specifically add new noexcept stuff to vector and string's move-assignment operations 2015-08-18 18:57:00 +00:00
thread [libcxx] Mark most test/std/future tests as UNSUPPORTED in C++03 2015-08-28 05:06:04 +00:00
utilities [libcxx] Rewrite C++03 __invoke. 2015-08-26 20:15:02 +00:00
nothing_to_do.pass.cpp