• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -std=c++11 %s -Wunused -verify
2 
3 struct MoveOnly {
4   MoveOnly(MoveOnly&&);
5   MoveOnly(const MoveOnly&);
6 };
7 
8 template<typename T> T &&move(T&);
test_special_member_functions(MoveOnly mo,int i)9 void test_special_member_functions(MoveOnly mo, int i) {
10   auto lambda1 = [i]() { }; // expected-note {{lambda expression begins here}} expected-note 2{{candidate}}
11 
12   // Default constructor
13   decltype(lambda1) lambda2; // expected-error{{no matching constructor}}
14 
15   // Copy assignment operator
16   lambda1 = lambda1; // expected-error{{copy assignment operator is implicitly deleted}}
17 
18   // Move assignment operator
19   lambda1 = move(lambda1);
20 
21   // Copy constructor
22   decltype(lambda1) lambda3 = lambda1;
23   decltype(lambda1) lambda4(lambda1);
24 
25   // Move constructor
26   decltype(lambda1) lambda5 = move(lambda1);
27   decltype(lambda1) lambda6(move(lambda1));
28 }
29