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
12// <future>
13
14// class future<R>
15
16// future& operator=(const future&) = delete;
17
18#include <future>
19
20#include "test_macros.h"
21
22int main()
23{
24#if TEST_STD_VER >= 11
25    {
26        std::future<int> f0, f;
27        f = f0; // expected-error {{overload resolution selected deleted operator '='}}
28    }
29    {
30        std::future<int &> f0, f;
31        f = f0; // expected-error {{overload resolution selected deleted operator '='}}
32    }
33    {
34        std::future<void> f0, f;
35        f = f0; // expected-error {{overload resolution selected deleted operator '='}}
36    }
37#else
38    {
39        std::future<int> f0, f;
40        f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future<int>'}}
41    }
42    {
43        std::future<int &> f0, f;
44        f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future<int &>'}}
45    }
46    {
47        std::future<void> f0, f;
48        f = f0; // expected-error {{'operator=' is a private member of 'std::__1::future<void>'}}
49    }
50#endif
51}
52