2012-12-12 02:53:07 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s
|
2011-02-15 07:59:16 +08:00
|
|
|
|
|
|
|
@interface I
|
2013-03-27 08:02:21 +08:00
|
|
|
- Meth; // expected-note 2 {{method 'Meth' declared here}}
|
2012-12-12 02:53:07 +08:00
|
|
|
- unavailableMeth __attribute__((availability(macosx,unavailable)));
|
|
|
|
- unavailableMeth2 __attribute__((unavailable));
|
2011-02-15 07:59:16 +08:00
|
|
|
@end
|
|
|
|
|
2013-03-27 08:02:21 +08:00
|
|
|
@implementation I // expected-warning {{method definition for 'Meth' not found}}
|
2011-02-15 07:59:16 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation I(CAT)
|
2011-07-29 07:19:50 +08:00
|
|
|
- Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
|
2011-02-15 07:59:16 +08:00
|
|
|
@end
|
|
|
|
|
2018-07-07 09:50:20 +08:00
|
|
|
// rdar://40634455
|
|
|
|
@interface MyClass
|
|
|
|
-(void)mymeth __attribute__((availability(macos, introduced=100))); // expected-note{{here}}
|
|
|
|
@end
|
|
|
|
@implementation MyClass // expected-warning{{'mymeth' not found}}
|
|
|
|
@end
|
|
|
|
|
2011-02-15 07:59:16 +08:00
|
|
|
#pragma GCC diagnostic ignored "-Wincomplete-implementation"
|
|
|
|
@interface I2
|
2012-02-28 06:55:11 +08:00
|
|
|
- Meth; // expected-note{{method 'Meth' declared here}}
|
2011-02-15 07:59:16 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation I2
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation I2(CAT)
|
2011-07-29 07:19:50 +08:00
|
|
|
- Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
|
2011-02-15 07:59:16 +08:00
|
|
|
@end
|
|
|
|
|
2011-10-27 08:09:34 +08:00
|
|
|
@interface Q
|
|
|
|
@end
|
|
|
|
|
|
|
|
// rdar://10336158
|
|
|
|
@implementation Q
|
|
|
|
|
|
|
|
__attribute__((visibility("default")))
|
2012-03-24 07:24:23 +08:00
|
|
|
@interface QN // expected-error {{Objective-C declarations may only appear in global scope}}
|
2011-10-27 08:09:34 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@end
|
2011-02-15 07:59:16 +08:00
|
|
|
|
2013-12-06 04:52:31 +08:00
|
|
|
// rdar://15580969
|
|
|
|
typedef char BOOL;
|
|
|
|
|
|
|
|
@protocol NSObject
|
|
|
|
- (BOOL)isEqual:(id)object;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSObject <NSObject>
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol NSApplicationDelegate <NSObject>
|
|
|
|
- (void)ImpleThisMethod; // expected-note {{method 'ImpleThisMethod' declared here}}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation AppDelegate (MRRCategory)
|
|
|
|
|
|
|
|
- (BOOL)isEqual:(id)object
|
|
|
|
{
|
|
|
|
return __objc_no;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)ImpleThisMethod {} // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
|
|
|
|
@end
|