126f4b32fSDouglas Gregor // RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++11 %s
2db0b9f12SDouglas Gregor 
3db0b9f12SDouglas Gregor class C {
4db0b9f12SDouglas Gregor 
5db0b9f12SDouglas Gregor   int f() {
6db0b9f12SDouglas Gregor     int foo, bar;
7db0b9f12SDouglas Gregor 
8db0b9f12SDouglas Gregor     []; // expected-error {{expected body of lambda expression}}
9db0b9f12SDouglas Gregor     [+] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
10db0b9f12SDouglas Gregor     [foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
11db0b9f12SDouglas Gregor     [foo,&this] {}; // expected-error {{'this' cannot be captured by reference}}
12db0b9f12SDouglas Gregor     [&this] {}; // expected-error {{'this' cannot be captured by reference}}
13db0b9f12SDouglas Gregor     [&,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
14db0b9f12SDouglas Gregor     [=,] {}; // expected-error {{expected variable name or 'this' in lambda capture list}}
15*656bc62aSDouglas Gregor     [] {};
16*656bc62aSDouglas Gregor     [=] (int i) {};
17*656bc62aSDouglas Gregor     [&] (int) mutable -> void {};
18*656bc62aSDouglas Gregor     [foo,bar] () { return 3; };
19*656bc62aSDouglas Gregor     [=,&foo] () {};
20*656bc62aSDouglas Gregor     [&,foo] () {};
21*656bc62aSDouglas Gregor     [this] () {};
22db0b9f12SDouglas Gregor 
23db0b9f12SDouglas Gregor     return 1;
24db0b9f12SDouglas Gregor   }
25db0b9f12SDouglas Gregor 
26db0b9f12SDouglas Gregor };
27db0b9f12SDouglas Gregor 
28