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