summaryrefslogtreecommitdiffstats
path: root/libcxx/test/thread/futures
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2013-10-12 22:49:17 +0000
committerMarshall Clow <mclow.lists@gmail.com>2013-10-12 22:49:17 +0000
commitd58daf94337f5e06d867c64869f2763e73f01df2 (patch)
tree5ae244e6bb9f33f821fc4e031e878f72fedbe6bd /libcxx/test/thread/futures
parentb212f3baa1c17e7739d4cebba3b3697292cf796e (diff)
downloadbcm5719-llvm-d58daf94337f5e06d867c64869f2763e73f01df2.tar.gz
bcm5719-llvm-d58daf94337f5e06d867c64869f2763e73f01df2.zip
LWG Issue 2097: packaged_task constructors should be constrained
llvm-svn: 192544
Diffstat (limited to 'libcxx/test/thread/futures')
-rw-r--r--libcxx/test/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp29
-rw-r--r--libcxx/test/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp30
2 files changed, 59 insertions, 0 deletions
diff --git a/libcxx/test/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp b/libcxx/test/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp
new file mode 100644
index 00000000000..45048b747f7
--- /dev/null
+++ b/libcxx/test/thread/futures/futures.tas/futures.task.members/ctor1.fail.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <future>
+
+// class packaged_task<R(ArgTypes...)>
+// template <class F>
+// packaged_task(F&& f);
+// These constructors shall not participate in overload resolution if
+// decay<F>::type is the same type as std::packaged_task<R(ArgTypes...)>.
+
+#include <future>
+#include <cassert>
+
+struct A {};
+typedef std::packaged_task<A(int, char)> PT;
+typedef volatile std::packaged_task<A(int, char)> VPT;
+
+
+int main()
+{
+ PT p { VPT{} };
+}
diff --git a/libcxx/test/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp b/libcxx/test/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp
new file mode 100644
index 00000000000..e81adfa6dcd
--- /dev/null
+++ b/libcxx/test/thread/futures/futures.tas/futures.task.members/ctor2.fail.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <future>
+
+// class packaged_task<R(ArgTypes...)>
+// template <class F, class Allocator>
+// explicit packaged_task(allocator_arg_t, const Allocator& a, F&& f);
+// These constructors shall not participate in overload resolution if
+// decay<F>::type is the same type as std::packaged_task<R(ArgTypes...)>.
+
+#include <future>
+#include <cassert>
+
+#include "../../test_allocator.h"
+
+struct A {};
+typedef std::packaged_task<A(int, char)> PT;
+typedef volatile std::packaged_task<A(int, char)> VPT;
+
+int main()
+{
+ PT p { std::allocator_arg_t{}, test_allocator<A>{}, VPT {}};
+}
OpenPOWER on IntegriCloud