summaryrefslogtreecommitdiffstats
path: root/test/Parser/objcxx0x-lambda-expressions.mm
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/Parser/objcxx0x-lambda-expressions.mm
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/Parser/objcxx0x-lambda-expressions.mm')
-rw-r--r--test/Parser/objcxx0x-lambda-expressions.mm24
1 files changed, 22 insertions, 2 deletions
diff --git a/test/Parser/objcxx0x-lambda-expressions.mm b/test/Parser/objcxx0x-lambda-expressions.mm
index fb90b16..bef576a 100644
--- a/test/Parser/objcxx0x-lambda-expressions.mm
+++ b/test/Parser/objcxx0x-lambda-expressions.mm
@@ -1,9 +1,10 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -std=c++11 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused-value -Wno-c++1y-extensions -std=c++11 %s
class C {
+ id get(int);
void f() {
- int foo, bar;
+ int foo, bar, baz;
// fail to parse as a lambda introducer, so we get objc message parsing errors instead
[foo,+] {}; // expected-error {{expected expression}}
@@ -17,6 +18,25 @@ class C {
[foo,bar] () { return 3; };
[=,&foo] () {};
[this] () {};
+
+ [foo(bar)] () {};
+ [foo = bar] () {};
+ [foo{bar}] () {}; // expected-error {{<initializer_list>}}
+ [foo = {bar}] () {}; // expected-error {{<initializer_list>}}
+
+ [foo(bar) baz] () {}; // expected-error {{called object type 'int' is not a function}}
+ [foo(bar), baz] () {}; // ok
+
+ [foo = bar baz]; // expected-warning {{receiver type 'int'}} expected-warning {{instance method '-baz'}}
+
+ [get(bar) baz]; // expected-warning {{instance method '-baz'}}
+ [get(bar), baz]; // expected-error {{expected body of lambda}}
+
+ [foo = bar ++ baz]; // expected-warning {{receiver type 'int'}} expected-warning {{instance method '-baz'}}
+ [foo = bar + baz]; // expected-error {{expected body of lambda}}
+ [foo = { bar, baz }]; // expected-error {{<initializer_list>}} expected-error {{expected body of lambda}}
+ [foo = { bar } baz ]; // expected-warning {{receiver type 'int'}} expected-warning {{instance method '-baz'}}
+ [foo = { bar }, baz ]; // expected-error {{<initializer_list>}} expected-error {{expected body of lambda}}
}
};
OpenPOWER on IntegriCloud