blob: b5a445cd9ec5f523cfdb33c5c3a17a36841b5d8e [file] [log] [blame]
Douglas Gregor1a22d282012-02-12 17:34:23 +00001// RUN: %clang_cc1 -std=c++11 %s -Wunused -verify
2
3struct MoveOnly {
4 MoveOnly(MoveOnly&&);
5 MoveOnly(const MoveOnly&);
6};
7
8template<typename T> T &&move(T&);
9void test_special_member_functions(MoveOnly mo, int i) {
10 // FIXME: terrible note
11 auto lambda1 = [i]() { }; // expected-note{{function has been explicitly marked deleted here}} \
12 // expected-note{{the implicit copy assignment operator}} \
13 // expected-note{{the implicit move assignment operator}} \
14
15 // Default constructor
16 decltype(lambda1) lambda2; // expected-error{{call to deleted constructor}}
17
18 // Copy assignment operator
19 lambda1 = lambda1; // expected-error{{overload resolution selected deleted operator '='}}
20
21 // Move assignment operator
22 lambda1 = move(lambda1);
23
24 // Copy constructor
25 decltype(lambda1) lambda3 = lambda1;
26 decltype(lambda1) lambda4(lambda1);
27
28 // Move constructor
29 decltype(lambda1) lambda5 = move(lambda1);
30 decltype(lambda1) lambda6(move(lambda1));
31}