Keep the source location of the selector in ObjCMessageExpr.
[clang.git] / test / SemaObjC / protocol-lookup.m
blobed3fbe0f72bfc301b51fab7337c269ac99aa6e78
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 @protocol NSObject
3 - retain;
4 - release;
5 @end
7 @interface NSObject
8 - init;
9 - dealloc;
10 @end
12 @protocol Foo <NSObject>
13 @end
15 @protocol Bar <Foo>
16 @end
18 @interface Baz : NSObject {
19         id <Foo> _foo;
20         id <Bar> _bar;
22 - (id)initWithFoo:(id <Foo>)foo bar:(id <Bar>)bar;
23 @end
25 @implementation Baz
27 - (id)init
29         return [self initWithFoo:0 bar:0];
32 - (id)initWithFoo:(id <Foo>)foo bar:(id <Bar>)bar
34         self = [super init];
35         if (self != 0) {
36                 _foo = [foo retain];
37                 _bar = [bar retain];
38         }
39         return self;
42 - dealloc
44         [_foo release];
45         [_bar release];
46         [super dealloc];
47         return 0;
50 @end