blob: 1eab15bee98e1ff324858eba0eccdb86a062f0bd [file] [log] [blame]
Douglas Gregordcffcbf2012-02-09 01:26:17 +00001// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++11 %s
Douglas Gregorae7902c2011-08-04 15:30:47 +00002
3class C {
4
5 void f() {
6 int foo, bar;
7
8 // fail to parse as a lambda introducer, so we get objc message parsing errors instead
9 [foo,+] {}; // expected-error {{expected expression}}
10
11 []; // expected-error {{expected body of lambda expression}}
12 [=,foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
13 [&this] {}; // expected-error {{address expression must be an lvalue}}
Douglas Gregorb326ca82012-02-09 08:26:42 +000014 [] {};
15 [=] (int i) {};
16 [&] (int) mutable -> void {};
17 [foo,bar] () { return 3; };
18 [=,&foo] () {};
19 [this] () {};
Douglas Gregorae7902c2011-08-04 15:30:47 +000020 }
21
22};
23