summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-08-28 05:06:04 +0000
committerEric Fiselier <eric@efcs.ca>2015-08-28 05:06:04 +0000
commitcb38f75e29a56c45682d46753a45da0439ad86dd (patch)
tree2f5b44c8dc206b1f1584c28c89d3c262cd36cf8d /libcxx/test/std/thread/futures/futures.promise/default.pass.cpp
parentfc8e8c036028fb03ceffb22da99c650a1d24b13b (diff)
downloadbcm5719-llvm-cb38f75e29a56c45682d46753a45da0439ad86dd.tar.gz
bcm5719-llvm-cb38f75e29a56c45682d46753a45da0439ad86dd.zip
[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
Diffstat (limited to 'libcxx/test/std/thread/futures/futures.promise/default.pass.cpp')
-rw-r--r--libcxx/test/std/thread/futures/futures.promise/default.pass.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp b/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp
index 95c9657c633..d108b42756e 100644
--- a/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp
+++ b/libcxx/test/std/thread/futures/futures.promise/default.pass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
OpenPOWER on IntegriCloud