blob: c35d3f86360abd26797078024111a7e4899607f4 [file] [log] [blame]
Steve Naroffc1fcd2c2009-02-21 17:03:43 +00001// RUN: clang -fsyntax-only -verify %s
2
3typedef signed char BOOL;
4@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
5@protocol NSObject
6- (BOOL)isEqual:(id)object;
7@end
8@protocol NSCoding
9- (void)encodeWithCoder:(NSCoder *)aCoder;
10@end
11@interface NSObject <NSObject> {} @end
12@class NSArray, NSAttributedString, NSEvent, NSInputServer, NSImage;
13@interface NSController : NSObject <NSCoding> {} @end
14@class OzzyView;
15typedef struct _OzzyInset {} OzzyInset;
16@protocol OzzyP;
17typedef NSObject <OzzyP> Ozzy;
18@protocol OzzyAnchorP;
19typedef NSObject <OzzyAnchorP> OzzyAnchor;
20@protocol OzzyAnchorDelegateP
21- (BOOL)anchor:(OzzyAnchor *)anchor confirmRepresentedObject:(id)newObject;
22@end
23typedef NSObject <OzzyAnchorDelegateP> OzzyAnchorDelegate;
24// GCC doesn't warn about the following (which is inconsistent with it's handling of @interface below).
25@protocol OzzyAnchorP <OzzyP> // expected-warning{{cannot find protocol definition for 'OzzyP'}}
26 @property(nonatomic,retain) id representedObject;
27 @property(nonatomic,retain) Ozzy * contentGroup;
28@end
29@interface XXX : NSObject <OzzyP> // expected-warning{{cannot find protocol definition for 'OzzyP'}}
30@end
31@protocol OzzyActionDelegateP
32 @optional - (BOOL)elementView:(OzzyView *)elementView shouldDragElement:(Ozzy *)element;
33@end
34typedef NSObject <OzzyActionDelegateP> OzzyActionDelegate;
35@interface OzzyUnit : OzzyAnchorDelegate <OzzyAnchorDelegateP> {}
36@end
37@interface OzzyArrayUnit : OzzyUnit {} @end
38@implementation OzzyArrayUnit
39- (BOOL)willChangeLayoutForObjects:(NSArray *)objects fromObjects:(NSArray *)oldObjects {}
40- (void)_recalculateStoredArraysForAnchor:(OzzyAnchor *)anchor {
41 Ozzy * contentGroup = anchor.contentGroup;
42 if (contentGroup == ((void *)0)) {
43 // GCC doesn't warn about the following (which seems wrong).
44 contentGroup = anchor; // expected-warning{{incompatible pointer types assigning 'OzzyAnchor *', expected 'Ozzy *'}}
45 }
46}
47@end