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