Keep the source location of the selector in ObjCMessageExpr.
[clang.git] / test / SemaObjC / super-class-protocol-conformance.m
blobbf19c837f46a240cc4f8e96d9e8ad0e7bd37bbc3
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // rdar://7884086
4 @interface NSObject @end
6 @protocol TopProtocol
7   @property (readonly) id myString; // expected-warning {{property 'myString' requires method 'myString' to be defined}}
8 @end
10 @protocol SubProtocol <TopProtocol>
11 @end
13 @interface TopClass : NSObject <TopProtocol> {}
14 @end
16 @interface SubClass : TopClass <SubProtocol> {}
17 @end
19 @interface SubClass1 : TopClass {}      
20 @end
22 @implementation SubClass1 @end // Test1 - No Warning
24 @implementation TopClass  // expected-note {{implementation is here}}
25 @end
27 @implementation SubClass // Test3 - No Warning 
28 @end
30 @interface SubClass2  : TopClass<TopProtocol> 
31 @end
33 @implementation SubClass2 @end // Test 4 - No Warning
35 @interface SubClass3 : TopClass<SubProtocol> @end
36 @implementation SubClass3 @end  // Test 5 - No Warning 
38 @interface SubClass4 : SubClass3 @end
39 @implementation SubClass4 @end  // Test 5 - No Warning
41 @protocol NewProtocol
42   @property (readonly) id myNewString; // expected-warning {{property 'myNewString' requires method 'myNewString' to be defined}}
43 @end
45 @interface SubClass5 : SubClass4 <NewProtocol> @end
46 @implementation SubClass5 @end   // expected-note {{implementation is here}}
49 // Radar 8035776
50 @protocol SuperProtocol
51 @end
53 @interface Super <SuperProtocol> 
54 @end
56 @protocol ProtocolWithProperty <SuperProtocol>
57 @property (readonly, assign) id invalidationBacktrace; // expected-warning {{property 'invalidationBacktrace' requires method 'invalidationBacktrace' to be defined}}
58 @end
60 @interface INTF : Super <ProtocolWithProperty> 
61 @end
63 @implementation INTF @end // expected-note {{implementation is here}}