77 lines · plain
1// RUN: %clang_cc1 -pedantic -fsyntax-only -verify -Wno-objc-root-class %s2typedef signed char BOOL;3 4@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;5 6@protocol NSObject7- (BOOL)isEqual:(id)object;8@end9 10@protocol NSCoding11- (void)encodeWithCoder:(NSCoder *)aCoder;12@end13 14@interface NSObject <NSObject> {}15@end16 17typedef float CGFloat;18 19@interface NSResponder : NSObject <NSCoding> {}20@end21 22@protocol XCSelectionSource;23 24@interface XCSelection : NSResponder {}25- (NSObject <XCSelectionSource> *) source;26@end27 28extern NSString * const XCActiveSelectionLevel;29 30@interface XCActionManager : NSResponder {}31+defaultActionManager;32-selectionAtLevel:(NSString *const)s;33@end34 35@implementation XDMenuItemsManager // expected-warning {{cannot find interface declaration for 'XDMenuItemsManager'}}36+ (void)initialize {37 id<XCSelectionSource, NSObject> source = 38 [[[XCActionManager defaultActionManager] selectionAtLevel:XCActiveSelectionLevel] source];39}40@end41 42@protocol NSTextStorageDelegate;43@class NSNotification;44 45@interface NSTextStorage : NSObject46 47- (void)setDelegate:(id <NSTextStorageDelegate>)delegate; // expected-note{{passing argument to parameter 'delegate' here}}48- (id <NSTextStorageDelegate>)delegate;49 50@end51 52@protocol NSTextStorageDelegate <NSObject>53@optional54 55- (void)textStorageWillProcessEditing:(NSNotification *)notification;56- (void)textStorageDidProcessEditing:(NSNotification *)notification;57 58@end59 60@interface SKTText : NSObject {61 @private62 63 64 NSTextStorage *_contents;65}66@end67 68@implementation SKTText69 70 71- (NSTextStorage *)contents {72 [_contents setDelegate:self]; // expected-warning {{sending 'SKTText *' to parameter of incompatible type 'id<NSTextStorageDelegate>'}}73 return 0;74}75 76@end77