Marshall Clow | 5f2d5b9 | 2013-10-12 22:49:17 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Richard Barton | 037efda | 2016-03-23 21:04:11 +0000 | [diff] [blame] | 9 | // |
| 10 | // UNSUPPORTED: libcpp-has-no-threads |
Eric Fiselier | faa9a31 | 2015-08-19 04:10:15 +0000 | [diff] [blame] | 11 | // UNSUPPORTED: c++98, c++03 |
| 12 | |
Marshall Clow | 5f2d5b9 | 2013-10-12 22:49:17 +0000 | [diff] [blame] | 13 | // <future> |
| 14 | |
| 15 | // class packaged_task<R(ArgTypes...)> |
| 16 | // template <class F, class Allocator> |
Marshall Clow | 07546f3 | 2015-06-30 14:16:49 +0000 | [diff] [blame] | 17 | // packaged_task(allocator_arg_t, const Allocator& a, F&& f); |
Marshall Clow | 5f2d5b9 | 2013-10-12 22:49:17 +0000 | [diff] [blame] | 18 | // These constructors shall not participate in overload resolution if |
| 19 | // decay<F>::type is the same type as std::packaged_task<R(ArgTypes...)>. |
| 20 | |
| 21 | #include <future> |
| 22 | #include <cassert> |
| 23 | |
Eric Fiselier | faa9a31 | 2015-08-19 04:10:15 +0000 | [diff] [blame] | 24 | #include "test_allocator.h" |
Marshall Clow | 5f2d5b9 | 2013-10-12 22:49:17 +0000 | [diff] [blame] | 25 | |
| 26 | struct A {}; |
| 27 | typedef std::packaged_task<A(int, char)> PT; |
| 28 | typedef volatile std::packaged_task<A(int, char)> VPT; |
| 29 | |
| 30 | int main() |
| 31 | { |
Eric Fiselier | faa9a31 | 2015-08-19 04:10:15 +0000 | [diff] [blame] | 32 | 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)>')}} |
| 33 | // expected-note@future:* 1 {{candidate template ignored: disabled by 'enable_if'}} |
Marshall Clow | 5f2d5b9 | 2013-10-12 22:49:17 +0000 | [diff] [blame] | 34 | } |