From cb38f75e29a56c45682d46753a45da0439ad86dd Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Fri, 28 Aug 2015 05:06:04 +0000 Subject: [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 `` 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 `` 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 --- libcxx/test/std/thread/futures/version.pass.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'libcxx/test/std/thread/futures/version.pass.cpp') diff --git a/libcxx/test/std/thread/futures/version.pass.cpp b/libcxx/test/std/thread/futures/version.pass.cpp index 6730a1477db..e69de29bb2d 100644 --- a/libcxx/test/std/thread/futures/version.pass.cpp +++ b/libcxx/test/std/thread/futures/version.pass.cpp @@ -1,22 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: libcpp-has-no-threads - -// - -#include - -#ifndef _LIBCPP_VERSION -#error _LIBCPP_VERSION not defined -#endif - -int main() -{ -} -- cgit v1.2.3