diff options
Diffstat (limited to 'test/SemaObjC/call-unavailable-init-in-self.m')
-rw-r--r-- | test/SemaObjC/call-unavailable-init-in-self.m | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/test/SemaObjC/call-unavailable-init-in-self.m b/test/SemaObjC/call-unavailable-init-in-self.m index fa6f670cc9..48fc2326af 100644 --- a/test/SemaObjC/call-unavailable-init-in-self.m +++ b/test/SemaObjC/call-unavailable-init-in-self.m @@ -5,13 +5,24 @@ + (instancetype)new; + (instancetype)alloc; +- (void)declaredInSuper; + +@end + +@interface NSObject (Category) + +- (void)declaredInSuperCategory; + @end @interface Sub: NSObject - (instancetype)init __attribute__((unavailable)); // expected-note 4 {{'init' has been explicitly marked unavailable here}} -- (void)notImplemented __attribute__((unavailable)); // expected-note {{'notImplemented' has been explicitly marked unavailable here}} +- (void)notImplemented __attribute__((unavailable)); + +- (void)declaredInSuper __attribute__((unavailable)); +- (void)declaredInSuperCategory __attribute__((unavailable)); @end @@ -34,7 +45,14 @@ } - (void)reportUseOfUnimplemented { - [self notImplemented]; // expected-error {{'notImplemented' is unavailable}} + [self notImplemented]; +} + +- (void)allowSuperCallUsingSelf { + [self declaredInSuper]; + [[Sub alloc] declaredInSuper]; + [self declaredInSuperCategory]; + [[Sub alloc] declaredInSuperCategory]; } @end |