blob: ab213fb4ce723c6a8060dc5966b47bc31fbf3c9e [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Fariborz Jahanian4b6df3f2007-10-04 00:22:33 +00002
Fariborz Jahanianbd51b872007-09-20 20:26:44 +00003@class FOO, BAR;
4@class FOO, BAR;
5
6@interface INTF : FOO // expected-error {{cannot find interface declaration for 'FOO', superclass of 'INTF'}}
7@end
8
9@interface FOO
10- (BAR*) Meth1;
11- (FOO*) Meth2;
12@end
13
14@interface INTF1 : FOO
15@end
16
Chris Lattnerb8b96af2008-11-23 22:46:27 +000017@interface INTF2 : INTF1 // expected-note {{previous definition is here}}
Fariborz Jahanianbd51b872007-09-20 20:26:44 +000018@end
19
20
21@class INTF1, INTF2;
22
Chris Lattnerb8b96af2008-11-23 22:46:27 +000023@interface INTF2 : INTF1 // expected-error {{duplicate interface definition for class 'INTF2'}}
Fariborz Jahanianbd51b872007-09-20 20:26:44 +000024@end
Fariborz Jahaniancae27c52009-05-07 21:49:26 +000025
26// 2nd test of a forward class declaration matching a typedef name
27// referring to class object.
28// FIXME. This may become a negative test should we decide to make this an error.
29//
30@interface NSObject @end
31
32@protocol XCElementP @end
33
34typedef NSObject <XCElementP> XCElement;
35
36@interface XCElementMainImp {
37 XCElement * _editingElement;
38}
39@end
40
41@class XCElement;
42
43@implementation XCElementMainImp
44- (XCElement *)editingElement { return _editingElement; }
45@end
46
47