1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -Wno-c++1y-extensions -std=c++11 %s
9 // fail to parse as a lambda introducer, so we get objc message parsing errors instead
10 [foo,+] {}; // expected-error {{expected expression}}
12 []; // expected-error {{expected body of lambda expression}}
13 [=,foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
14 [&this] {}; // expected-error {{cannot take the address of an rvalue of type 'C *'}} \
15 // expected-error {{expected identifier}}
18 [&] (int) mutable -> void {};
19 [foo,bar] () { return 3; };
26 [foo = {bar}] () {}; // expected-error {{<initializer_list>}}
28 [foo(bar) baz] () {}; // expected-error {{called object type 'int' is not a function}} \
29 // expected-error {{expected ';'}}
30 [foo(bar), baz] () {}; // ok
32 [foo = bar baz]; // expected-warning {{receiver type 'int'}} expected-warning {{instance method '-baz'}}
34 [get(bar) baz]; // expected-warning {{instance method '-baz'}}
35 [get(bar), baz]; // expected-error {{expected body of lambda}}
37 [foo = bar ++ baz]; // expected-warning {{receiver type 'int'}} expected-warning {{instance method '-baz'}}
38 [foo = bar + baz]; // expected-error {{expected body of lambda}}
39 [foo = { bar, baz }]; // expected-error {{<initializer_list>}} expected-error {{expected body of lambda}}
40 [foo = { bar } baz ]; // expected-warning {{receiver type 'int'}} expected-warning {{instance method '-baz'}}
41 [foo = { bar }, baz ]; // expected-error {{<initializer_list>}} expected-error {{expected body of lambda}}
54 [val = getInt()]() { };
56 [val = getInt()]() { }