]> git.saurik.com Git - apple/objc4.git/blob - test/designatedinit.m
objc4-818.2.tar.gz
[apple/objc4.git] / test / designatedinit.m
1 // TEST_CONFIG
2 /* TEST_BUILD_OUTPUT
3 .*designatedinit.m:\d+:\d+: warning: designated initializer should only invoke a designated initializer on 'super'.*
4 .*designatedinit.m:\d+:\d+: note: .*
5 .*designatedinit.m:\d+:\d+: warning: method override for the designated initializer of the superclass '-init' not found.*
6 .*NSObject.h:\d+:\d+: note: .*
7 END */
8
9 #define NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER 1
10 #include "test.h"
11 #include <objc/NSObject.h>
12
13 @interface C : NSObject
14 -(id) initWithInt:(int)i NS_DESIGNATED_INITIALIZER;
15 @end
16
17 @implementation C
18 -(id) initWithInt:(int)__unused i {
19 return [self init];
20 }
21 @end
22
23 int main()
24 {
25 succeed(__FILE__);
26 }