From: Ted Kremenek Date: Tue, 16 Feb 2010 16:55:10 +0000 (+0000) Subject: Add test case showing that a recursive block that captures a block pointer that X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6418825fb8934128e847d17b0d0a171dcca32e9b;p=clang Add test case showing that a recursive block that captures a block pointer that isn't marked '__block' is bad. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96357 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/blocks.m b/test/Analysis/blocks.m index e8e96a22cf..b05b198c54 100644 --- a/test/Analysis/blocks.m +++ b/test/Analysis/blocks.m @@ -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