2011-10-14 06:29:44 +08:00
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2011-08-04 23:30:47 +08:00
class C {
void f() {
int foo, bar;
// fail to parse as a lambda introducer, so we get objc message parsing errors instead
[foo,+] {}; // expected-error {{expected expression}}
[]; // expected-error {{expected body of lambda expression}}
[=,foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
[&this] {}; // expected-error {{address expression must be an lvalue}}
2012-01-04 10:40:39 +08:00
[] {}; // expected-error {{lambda expressions are not supported yet}}
[=] (int i) {}; // expected-error {{lambda expressions are not supported yet}}
[&] (int) mutable -> void {}; // expected-error {{lambda expressions are not supported yet}}
2012-01-07 12:59:52 +08:00
// FIXME: Implicit return type deduction doesn't work yet.
[foo,bar] () { return 3; }; // expected-error {{void function 'f' should not return a value}} expected-error {{lambda expressions are not supported yet}}
2012-01-04 10:40:39 +08:00
[=,&foo] () {}; // expected-error {{lambda expressions are not supported yet}}
[this] () {}; // expected-error {{lambda expressions are not supported yet}}
2011-08-04 23:30:47 +08:00
}
};