summaryrefslogtreecommitdiffstats
path: root/test/CodeGenObjCXX/blocks.mm
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-06-12 15:46:16 +0000
committerdim <dim@FreeBSD.org>2011-06-12 15:46:16 +0000
commitc49018d9cce52d8c9f34b44865ec3ba8e89a1488 (patch)
treec5e9e10bc189de0058aa763c47b9920a8351b7df /test/CodeGenObjCXX/blocks.mm
parent110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (diff)
downloadFreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.zip
FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.tar.gz
Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
Diffstat (limited to 'test/CodeGenObjCXX/blocks.mm')
-rw-r--r--test/CodeGenObjCXX/blocks.mm18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/CodeGenObjCXX/blocks.mm b/test/CodeGenObjCXX/blocks.mm
index ffb916b..e220753 100644
--- a/test/CodeGenObjCXX/blocks.mm
+++ b/test/CodeGenObjCXX/blocks.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -x objective-c++ -fblocks -triple x86_64-apple-darwin %s
+// RUN: %clang_cc1 -x objective-c++ -fblocks -triple x86_64-apple-darwin %s -verify -emit-llvm -o %t
// rdar://8979379
@interface A
@@ -28,3 +28,19 @@ void foo(id <NSObject>(^objectCreationBlock)(void)) {
return bar(objectCreationBlock);
}
+// Test4
+struct S {
+ S *(^a)() = ^{ // expected-warning {{C++0x}}
+ return this;
+ };
+};
+S s;
+
+// Test5
+struct X {
+ void f() {
+ ^ {
+ struct Nested { Nested *ptr = this; }; // expected-warning {{C++0x}}
+ } ();
+ };
+};
OpenPOWER on IntegriCloud