1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-threads
14 // class packaged_task<R(ArgTypes...)>
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...)>.
24 typedef std::packaged_task
<A(int, char)> PT
;
25 typedef volatile std::packaged_task
<A(int, char)> VPT
;
31 auto const& c_init
= init
;
32 PT p1
{init
}; // expected-error {{no matching constructor}}
33 PT p2
{c_init
}; // expected-error {{no matching constructor}}
34 PT p3
{std::move(init
)}; // expected-error {{no matching constructor for initialization of 'PT' (aka 'packaged_task<A (int, char)>')}}