Home | History | Annotate | Download | only in futures.task.members
      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: libcpp-has-no-threads
     11 // UNSUPPORTED: c++98, c++03
     12 
     13 // <future>
     14 
     15 // class packaged_task<R(ArgTypes...)>
     16 // template <class F>
     17 //   packaged_task(F&& f);
     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 
     24 struct A {};
     25 typedef std::packaged_task<A(int, char)> PT;
     26 typedef volatile std::packaged_task<A(int, char)> VPT;
     27 
     28 
     29 int main()
     30 {
     31     VPT init{};
     32     auto const& c_init = init;
     33     PT p1{init}; // expected-error {{no matching constructor}}
     34     PT p2{c_init}; // expected-error {{no matching constructor}}
     35     PT p3{std::move(init)}; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}
     36 }
     37