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 //===----------------------------------------------------------------------===//
9 
10 // UNSUPPORTED: c++98, c++03
11 
12 // <future>
13 
14 // class packaged_task<R(ArgTypes...)>
15 // template <class F, class Allocator>
16 //   packaged_task(allocator_arg_t, const Allocator& a, F&& f);
17 // These constructors shall not participate in overload resolution if
18 //    decay<F>::type is the same type as std::packaged_task<R(ArgTypes...)>.
19 
20 #include <future>
21 #include <cassert>
22 
23 #include "test_allocator.h"
24 
25 struct A {};
26 typedef std::packaged_task<A(int, char)> PT;
27 typedef volatile std::packaged_task<A(int, char)> VPT;
28 
main()29 int main()
30 {
31     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)>')}}
32     // expected-note@future:* 1 {{candidate template ignored: disabled by 'enable_if'}}
33 }
34