From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Parser/objcxx0x-lambda-expressions.mm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 clang/test/Parser/objcxx0x-lambda-expressions.mm (limited to 'clang/test/Parser/objcxx0x-lambda-expressions.mm') diff --git a/clang/test/Parser/objcxx0x-lambda-expressions.mm b/clang/test/Parser/objcxx0x-lambda-expressions.mm new file mode 100644 index 0000000..1eab15b --- /dev/null +++ b/clang/test/Parser/objcxx0x-lambda-expressions.mm @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -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 {}; + [foo,bar] () { return 3; }; + [=,&foo] () {}; + [this] () {}; + } + +}; + -- cgit v1.2.3