Do not warn with -Wuninitialized when the member is used in a sizeof or address-of...
[clang.git] / test / SemaObjC / compatible-protocol-qualified-types.m
blob0342622a11e100e7d4ca2796a923f2df3a7ac1e8
1 // RUN: %clang_cc1 -pedantic -fsyntax-only -verify %s
2 typedef signed char BOOL;
4 @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
6 @protocol NSObject
7 - (BOOL)isEqual:(id)object;
8 @end
10 @protocol NSCoding
11 - (void)encodeWithCoder:(NSCoder *)aCoder;
12 @end
14 @interface NSObject <NSObject> {}
15 @end
17 typedef float CGFloat;
19 @interface NSResponder : NSObject <NSCoding> {}
20 @end
22 @protocol XCSelectionSource;
24 @interface XCSelection : NSResponder {}
25 - (NSObject <XCSelectionSource> *) source;
26 @end
28 extern NSString * const XCActiveSelectionLevel;
30 @interface XCActionManager : NSResponder {}
31 +defaultActionManager;
32 -selectionAtLevel:(NSString *const)s;
33 @end
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];
40 @end
42 @protocol NSTextStorageDelegate;
43 @class NSNotification;
45 @interface NSTextStorage : NSObject
47 - (void)setDelegate:(id <NSTextStorageDelegate>)delegate; // expected-note{{passing argument to parameter 'delegate' here}}
48 - (id <NSTextStorageDelegate>)delegate;
50 @end
52 @protocol NSTextStorageDelegate <NSObject>
53 @optional
55 - (void)textStorageWillProcessEditing:(NSNotification *)notification;
56 - (void)textStorageDidProcessEditing:(NSNotification *)notification;
58 @end
60 @interface SKTText : NSObject {
61     @private
64     NSTextStorage *_contents;
66 @end
68 @implementation SKTText
71 - (NSTextStorage *)contents {
72  [_contents setDelegate:self]; // expected-warning {{sending 'SKTText *' to parameter of incompatible type 'id<NSTextStorageDelegate>'}}
73  return 0;
76 @end