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>
16 //   packaged_task(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 struct A {};
24 typedef std::packaged_task<A(int, char)> PT;
25 typedef volatile std::packaged_task<A(int, char)> VPT;
26 
27 
main()28 int main()
29 {
30     PT p { VPT{} }; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
31     // expected-note@future:* 1 {{candidate template ignored: disabled by 'enable_if'}}
32 }
33