diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-03-08 00:22:50 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-03-08 00:22:50 +0000 |
commit | a34194f035096dd8dce10574e3a186da968aa211 (patch) | |
tree | 9bab5b692a8ef49d50856b3baac192f18dc4c829 /test/FixIt/fixit-recursive-block.c | |
parent | 044e645605c6d75223e33d23e3c5701cb389969f (diff) |
improve on diagnostic and provide a fixit hint when
an uninitialized block variable is being called inside the
block literal. // rdar://10817031
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt/fixit-recursive-block.c')
-rw-r--r-- | test/FixIt/fixit-recursive-block.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/FixIt/fixit-recursive-block.c b/test/FixIt/fixit-recursive-block.c new file mode 100644 index 0000000000..c1f69266b3 --- /dev/null +++ b/test/FixIt/fixit-recursive-block.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -Wuninitialized -fblocks -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -Wuninitialized -fblocks -verify %s + +// rdar://10817031 + +int main() { + void (^arc_fail)() = ^() { // expected-warning {{block pointer variable 'arc_fail' is uninitialized when captured by block}} \ + // expected-note {{consider using a '__block' variable 'arc_fail' to silence this warning}} + arc_fail(); // BOOM + }; +} +// CHECK: {7:12-7:12}:"__block " |