protocol-implementing-class-methods.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // rdar://7020493
  3. @protocol P1
  4. @optional
  5. - (int) PMeth;
  6. @required
  7. - (void) : (double) arg; // expected-note {{method declared here}}
  8. @end
  9. @interface NSImage <P1>
  10. - (void) initialize; // expected-note {{method declared here}}
  11. @end
  12. @interface NSImage (AirPortUI)
  13. - (void) initialize;
  14. @end
  15. @interface NSImage()
  16. - (void) CEMeth; // expected-note {{method declared here}}
  17. @end
  18. @implementation NSImage (AirPortUI)
  19. - (void) initialize {NSImage *p=0; [p initialize]; } // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
  20. - (int) PMeth{ return 0; }
  21. - (void) : (double) arg{}; // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
  22. - (void) CEMeth {}; // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
  23. @end
  24. // rdar://10014946
  25. typedef char BOOL;
  26. @interface I
  27. {
  28. BOOL allowsDeleting;
  29. }
  30. @property (nonatomic, assign, readwrite) BOOL allowsDeleting;
  31. @end
  32. @implementation I(CAT)
  33. - (BOOL) allowsDeleting { return 1; }
  34. @end