xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/warn-implicit-self-in-block.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c -fobjc-arc -fblocks -Wimplicit-retain-self -verify %s
2*f4a2713aSLionel Sambuc// rdar://11194874
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc@interface Root @end
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuc@interface I : Root
7*f4a2713aSLionel Sambuc{
8*f4a2713aSLionel Sambuc  int _bar;
9*f4a2713aSLionel Sambuc}
10*f4a2713aSLionel Sambuc@end
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc@implementation I
13*f4a2713aSLionel Sambuc  - (void)foo{
14*f4a2713aSLionel Sambuc      ^{
15*f4a2713aSLionel Sambuc           _bar = 3; // expected-warning {{block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior}}
16*f4a2713aSLionel Sambuc       }();
17*f4a2713aSLionel Sambuc  }
18*f4a2713aSLionel Sambuc@end
19