Steve Naroff | c1fcd2c | 2009-02-21 17:03:43 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | typedef 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; |
| 15 | typedef struct _OzzyInset {} OzzyInset; |
| 16 | @protocol OzzyP; |
| 17 | typedef NSObject <OzzyP> Ozzy; |
| 18 | @protocol OzzyAnchorP; |
| 19 | typedef NSObject <OzzyAnchorP> OzzyAnchor; |
| 20 | @protocol OzzyAnchorDelegateP |
| 21 | - (BOOL)anchor:(OzzyAnchor *)anchor confirmRepresentedObject:(id)newObject; |
| 22 | @end |
| 23 | typedef 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 |
| 34 | typedef 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 |