From 36981b17ed939300f6f8fc2355a255f711fcef71 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 20 Oct 2011 21:14:49 +0000 Subject: Vendor import of clang release_30 branch r142614: http://llvm.org/svn/llvm-project/cfe/branches/release_30@142614 --- test/Parser/objcxx0x-lambda-expressions.mm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/Parser/objcxx0x-lambda-expressions.mm (limited to 'test/Parser/objcxx0x-lambda-expressions.mm') diff --git a/test/Parser/objcxx0x-lambda-expressions.mm b/test/Parser/objcxx0x-lambda-expressions.mm new file mode 100644 index 000000000000..937464918b6a --- /dev/null +++ b/test/Parser/objcxx0x-lambda-expressions.mm @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s + +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}} + [] {}; + [=] (int i) {}; + [&] (int) mutable -> void {}; + // FIXME: this error occurs because we do not yet handle lambda scopes + // properly. I did not anticipate it because I thought it was a semantic (not + // syntactic) check. + [foo,bar] () { return 3; }; // expected-error {{void function 'f' should not return a value}} + [=,&foo] () {}; + [this] () {}; + } + +}; + -- cgit v1.3