designatedinit.m 656 B

1234567891011121314151617181920212223242526
  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. #define NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER 1
  9. #include "test.h"
  10. #include <objc/NSObject.h>
  11. @interface C : NSObject
  12. -(id) initWithInt:(int)i NS_DESIGNATED_INITIALIZER;
  13. @end
  14. @implementation C
  15. -(id) initWithInt:(int)__unused i {
  16. return [self init];
  17. }
  18. @end
  19. int main()
  20. {
  21. succeed(__FILE__);
  22. }