xref: /llvm-project/libcxx/test/std/thread/futures/futures.unique_future/copy_ctor.verify.cpp (revision 72f0edf3f4291d2614719a8c8af21a7a62ed5d74)
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // UNSUPPORTED: no-threads
10 
11 // <future>
12 
13 // class future<R>
14 
15 // future(const future&) = delete;
16 
17 #include <future>
18 
f()19 void f() {
20     {
21         std::future<int> f0;
22         std::future<int> f = f0; // expected-error {{call to deleted constructor of 'std::future<int>'}}
23     }
24     {
25         std::future<int &> f0;
26         std::future<int &> f = f0; // expected-error {{call to deleted constructor of 'std::future<int &>'}}
27     }
28     {
29         std::future<void> f0;
30         std::future<void> f = f0; // expected-error {{call to deleted constructor of 'std::future<void>'}}
31     }
32 }
33