xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/inst-method-lookup-in-root.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1  -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc
3*f4a2713aSLionel Sambuc@protocol P
4*f4a2713aSLionel Sambuc- (id) inst_in_proto;
5*f4a2713aSLionel Sambuc@end
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc@interface Object <P>
8*f4a2713aSLionel Sambuc- (id) inst_in_root;
9*f4a2713aSLionel Sambuc@end
10*f4a2713aSLionel Sambuc
11*f4a2713aSLionel Sambuc@interface Base
12*f4a2713aSLionel Sambuc@end
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc@interface Derived: Base
15*f4a2713aSLionel Sambuc- (id)starboard;
16*f4a2713aSLionel Sambuc@end
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambucvoid foo(void) {
19*f4a2713aSLionel Sambuc  Class receiver;
20*f4a2713aSLionel Sambuc
21*f4a2713aSLionel Sambuc  [Derived starboard]; // expected-warning {{method '+starboard' not found}}
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc  [receiver starboard]; // expected-warning {{instance method 'starboard' is being used on 'Class'}}
24*f4a2713aSLionel Sambuc  [receiver inst_in_root]; // Ok!
25*f4a2713aSLionel Sambuc  [receiver inst_in_proto]; // Ok!
26*f4a2713aSLionel Sambuc}
27*f4a2713aSLionel Sambuc
28