]> granicus.if.org Git - clang/commitdiff
Add test case showing that a recursive block that captures a block pointer that
authorTed Kremenek <kremenek@apple.com>
Tue, 16 Feb 2010 16:55:10 +0000 (16:55 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 16 Feb 2010 16:55:10 +0000 (16:55 +0000)
isn't marked '__block' is bad.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96357 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/blocks.m

index e8e96a22cf9eb169dba45fd80110843f02ba1eb0..b05b198c5489cd8345345c7260cc8170893a000d 100644 (file)
@@ -83,3 +83,8 @@ void test2_b() {
   // 'x' is bound at block creation.
   ^{ y = x + 1; }(); // no-warning
 }
+
+void test2_c() {
+  typedef void (^myblock)(void);
+  myblock f = ^() { f(); }; // expected-warning{{Variable 'f' is captured by block with a garbage value}}
+}
\ No newline at end of file