Add test case showing that a recursive block that captures a block pointer that

isn't marked '__block' is bad.

llvm-svn: 96357
This commit is contained in:
Ted Kremenek 2010-02-16 16:55:10 +00:00
parent bc91b44a23
commit 3eac2454dc
1 changed files with 5 additions and 0 deletions

View 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}}
}