[libcxx] r245413 - Mark std::packaged_task tests as unsupported in C++03.
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 18 21:10:15 PDT 2015
Author: ericwf
Date: Tue Aug 18 23:10:15 2015
New Revision: 245413
URL: http://llvm.org/viewvc/llvm-project?rev=245413&view=rev
Log:
Mark std::packaged_task tests as unsupported in C++03.
std::packaged_task requires variadic templates and is #ifdef out in C++03.
This patch silences the tests in C++03. This patch also rewrites the .fail.cpp tests so that they use clang verify.
Modified:
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp
libcxx/trunk/test/std/thread/futures/futures.tas/types.pass.cpp
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/assign_copy.fail.cpp Tue Aug 18 23:10:15 2015
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <future>
// class packaged_task<R(ArgTypes...)>
@@ -14,35 +16,11 @@
// packaged_task& operator=(packaged_task&) = delete;
#include <future>
-#include <cassert>
-
-class A
-{
- long data_;
-
-public:
- explicit A(long i) : data_(i) {}
-
- long operator()(long i, long j) const {return data_ + i + j;}
-};
int main()
{
{
- std::packaged_task<double(int, char)> p0(A(5));
- std::packaged_task<double(int, char)> p;
- p = p0;
- assert(!p0.valid());
- assert(p.valid());
- std::future<double> f = p.get_future();
- p(3, 'a');
- assert(f.get() == 105.0);
- }
- {
- std::packaged_task<double(int, char)> p0;
- std::packaged_task<double(int, char)> p;
- p = p0;
- assert(!p0.valid());
- assert(!p.valid());
+ std::packaged_task<double(int, char)> p0, p;
+ p = p0; // expected-error {{overload resolution selected deleted operator '='}}
}
}
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/assign_move.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp Tue Aug 18 23:10:15 2015
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <future>
// class packaged_task<R(ArgTypes...)>
@@ -25,5 +27,6 @@ typedef volatile std::packaged_task<A(in
int main()
{
- PT p { VPT{} };
+ PT p { VPT{} }; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
+ // expected-note at future:* 1 {{candidate template ignored: disabled by 'enable_if'}}
}
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp Tue Aug 18 23:10:15 2015
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <future>
// class packaged_task<R(ArgTypes...)>
@@ -18,7 +20,7 @@
#include <future>
#include <cassert>
-#include "../../test_allocator.h"
+#include "test_allocator.h"
struct A {};
typedef std::packaged_task<A(int, char)> PT;
@@ -26,5 +28,6 @@ typedef volatile std::packaged_task<A(in
int main()
{
- PT p { std::allocator_arg_t{}, test_allocator<A>{}, VPT {}};
+ PT p { std::allocator_arg_t{}, test_allocator<A>{}, VPT {}}; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
+ // expected-note at future:* 1 {{candidate template ignored: disabled by 'enable_if'}}
}
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_copy.fail.cpp Tue Aug 18 23:10:15 2015
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+// UNSUPPORTED: c++98, c++03
+
// <future>
// class packaged_task<R(ArgTypes...)>
@@ -14,33 +16,12 @@
// packaged_task(packaged_task&) = delete;
#include <future>
-#include <cassert>
-
-class A
-{
- long data_;
-public:
- explicit A(long i) : data_(i) {}
-
- long operator()(long i, long j) const {return data_ + i + j;}
-};
int main()
{
{
- std::packaged_task<double(int, char)> p0(A(5));
- std::packaged_task<double(int, char)> p(p0);
- assert(!p0.valid());
- assert(p.valid());
- std::future<double> f = p.get_future();
- p(3, 'a');
- assert(f.get() == 105.0);
- }
- {
std::packaged_task<double(int, char)> p0;
- std::packaged_task<double(int, char)> p(p0);
- assert(!p0.valid());
- assert(!p.valid());
+ std::packaged_task<double(int, char)> p(p0); // expected-error {{call to deleted constructor of 'std::packaged_task<double (int, char)>'}}
}
}
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_default.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_func.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_func_alloc.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
@@ -19,7 +20,7 @@
#include <future>
#include <cassert>
-#include "../../test_allocator.h"
+#include "test_allocator.h"
#include "min_allocator.h"
class A
@@ -47,7 +48,7 @@ int main()
{
std::packaged_task<double(int, char)> p(std::allocator_arg,
test_allocator<A>(), A(5));
- assert(test_alloc_base::count > 0);
+ assert(test_alloc_base::alloc_count > 0);
assert(p.valid());
std::future<double> f = p.get_future();
p(3, 'a');
@@ -55,14 +56,14 @@ int main()
assert(A::n_copies == 0);
assert(A::n_moves > 0);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
A::n_copies = 0;
A::n_moves = 0;
{
A a(5);
std::packaged_task<double(int, char)> p(std::allocator_arg,
test_allocator<A>(), a);
- assert(test_alloc_base::count > 0);
+ assert(test_alloc_base::alloc_count > 0);
assert(p.valid());
std::future<double> f = p.get_future();
p(3, 'a');
@@ -70,31 +71,31 @@ int main()
assert(A::n_copies > 0);
assert(A::n_moves > 0);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
A::n_copies = 0;
A::n_moves = 0;
{
A a(5);
std::packaged_task<int(int)> p(std::allocator_arg, test_allocator<A>(), &func);
- assert(test_alloc_base::count > 0);
+ assert(test_alloc_base::alloc_count > 0);
assert(p.valid());
std::future<int> f = p.get_future();
p(4);
assert(f.get() == 4);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
A::n_copies = 0;
A::n_moves = 0;
{
A a(5);
std::packaged_task<int(int)> p(std::allocator_arg, test_allocator<A>(), func);
- assert(test_alloc_base::count > 0);
+ assert(test_alloc_base::alloc_count > 0);
assert(p.valid());
std::future<int> f = p.get_future();
p(4);
assert(f.get() == 4);
}
- assert(test_alloc_base::count == 0);
+ assert(test_alloc_base::alloc_count == 0);
A::n_copies = 0;
A::n_moves = 0;
{
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/ctor_move.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/dtor.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/get_future.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/make_ready_at_thread_exit.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/operator.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/reset.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.members/swap.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.nonmembers/swap.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/futures.task.nonmembers/uses_allocator.pass.cpp Tue Aug 18 23:10:15 2015
@@ -9,6 +9,12 @@
//
// UNSUPPORTED: libcpp-has-no-threads
+// This test is marked XFAIL and not UNSUPPORTED because the non-variadic
+// declaration of packaged_task is available in C++03. Therefore the test
+// should fail because the static_assert fires and not because std::packaged_task
+// in undefined.
+// XFAIL: c++98, c++03
+
// <future>
// class packaged_task<R(ArgTypes...)>
@@ -18,7 +24,7 @@
// : true_type { };
#include <future>
-#include "../../test_allocator.h"
+#include "test_allocator.h"
int main()
{
Modified: libcxx/trunk/test/std/thread/futures/futures.tas/types.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/thread/futures/futures.tas/types.pass.cpp?rev=245413&r1=245412&r2=245413&view=diff
==============================================================================
--- libcxx/trunk/test/std/thread/futures/futures.tas/types.pass.cpp (original)
+++ libcxx/trunk/test/std/thread/futures/futures.tas/types.pass.cpp Tue Aug 18 23:10:15 2015
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
//
// UNSUPPORTED: libcpp-has-no-threads
+// UNSUPPORTED: c++98, c++03
// <future>
More information about the cfe-commits
mailing list