objective-C arc: Warn under arc about a use of an ivar inside a block
that doesn't have a 'self' as this implicitly captures 'self' and could
create retain cycles. Provide fixit. // rdar://11194874
llvm-svn: 165133
diff --git a/clang/test/SemaObjC/warn-implicit-self-in-block.m b/clang/test/SemaObjC/warn-implicit-self-in-block.m
new file mode 100644
index 0000000..6a19283
--- /dev/null
+++ b/clang/test/SemaObjC/warn-implicit-self-in-block.m
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -x objective-c -fobjc-arc -fblocks -verify %s
+// rdar://11194874
+
+@interface Root @end
+
+@interface I : Root
+{
+ int _bar;
+}
+@end
+
+@implementation I
+ - (void)foo{
+ ^{
+ _bar = 3; // expected-warning {{block implicitily retains 'self' - explicitly mention 'self' to indicate this is intended behavior}}
+ }();
+ }
+@end