diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-12-14 02:16:41 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-12-14 02:16:41 +0000 |
| commit | 0f7f222c59c8673862aa4272803e84a05d9b925d (patch) | |
| tree | c940fefe3d77383486738db020efb1d74a6fc072 | |
| parent | c8064ac62683b597c6bb70e3baf6d33acb60f0f4 (diff) | |
| download | bcm5719-llvm-0f7f222c59c8673862aa4272803e84a05d9b925d.tar.gz bcm5719-llvm-0f7f222c59c8673862aa4272803e84a05d9b925d.zip | |
[objc] Add a test to make sure that a class can add a secondary initializer via a category
and still inherit the designated initializers of its super class.
llvm-svn: 197301
| -rw-r--r-- | clang/test/SemaObjC/attr-designated-init.m | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/clang/test/SemaObjC/attr-designated-init.m b/clang/test/SemaObjC/attr-designated-init.m index 5a35a36e845..0432a1859bb 100644 --- a/clang/test/SemaObjC/attr-designated-init.m +++ b/clang/test/SemaObjC/attr-designated-init.m @@ -34,7 +34,7 @@ __attribute__((objc_root_class)) __attribute__((objc_root_class)) @interface B1 --(id)initB1 NS_DESIGNATED_INITIALIZER; // expected-note 5 {{method marked as designated initializer of the class here}} +-(id)initB1 NS_DESIGNATED_INITIALIZER; // expected-note 6 {{method marked as designated initializer of the class here}} -(id)initB2; -(id)initB3 NS_DESIGNATED_INITIALIZER; // expected-note 3 {{method marked as designated initializer of the class here}} @end @@ -219,3 +219,22 @@ __attribute__((objc_root_class)) return [super init]; } @end + +@interface S9 : B1 +-(id)initB1; +-(id)initB3; +@end + +@interface S9(secondInit) +-(id)initNewOne; +@end + +@interface SS9 : S9 +-(id)initB1; +@end + +@implementation SS9 +-(id)initB1 { // expected-warning {{designated initializer missing a 'super' call to a designated initializer of the super class}} + return 0; +} +@end |

