summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-12-03 21:11:54 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-12-03 21:11:54 +0000
commitdb5ce0f71ec99f0e60b99b6353b2e925af6c881b (patch)
tree345eb6ea6d7e265092b9a07285a53a3aa5fa744a /clang/test
parentb66d3cf5cf8400d9c99d5dd237ab6908377bbbfa (diff)
downloadbcm5719-llvm-db5ce0f71ec99f0e60b99b6353b2e925af6c881b.tar.gz
bcm5719-llvm-db5ce0f71ec99f0e60b99b6353b2e925af6c881b.zip
[objc] Add a warning when a class that provides a designated initializer, does not
override all of the designated initializers of its superclass. llvm-svn: 196319
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaObjC/attr-designated-init.m14
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/test/SemaObjC/attr-designated-init.m b/clang/test/SemaObjC/attr-designated-init.m
index 513e51515d6..3d8bd1c3e5e 100644
--- a/clang/test/SemaObjC/attr-designated-init.m
+++ b/clang/test/SemaObjC/attr-designated-init.m
@@ -34,9 +34,9 @@ __attribute__((objc_root_class))
__attribute__((objc_root_class))
@interface B1
--(id)initB1 NS_DESIGNATED_INITIALIZER; // expected-note 2 {{method marked as designated initializer of the class here}}
+-(id)initB1 NS_DESIGNATED_INITIALIZER; // expected-note 4 {{method marked as designated initializer of the class here}}
-(id)initB2;
--(id)initB3 NS_DESIGNATED_INITIALIZER; // expected-note {{method marked as designated initializer of the class here}}
+-(id)initB3 NS_DESIGNATED_INITIALIZER; // expected-note 3 {{method marked as designated initializer of the class here}}
@end
@implementation B1
@@ -82,21 +82,22 @@ __attribute__((objc_root_class))
-(id)initSS1 NS_DESIGNATED_INITIALIZER;
@end
-@implementation SS2
+@implementation SS2 // expected-warning {{method override for the designated initializer of the superclass '-initB1' not found}} \
+ // expected-warning {{method override for the designated initializer of the superclass '-initB3' not found}}
-(id)initSS1 {
return [super initB1];
}
@end
@interface S3 : B1
--(id)initS1 NS_DESIGNATED_INITIALIZER;
+-(id)initS1 NS_DESIGNATED_INITIALIZER; // expected-note {{method marked as designated initializer of the class here}}
@end
@interface SS3 : S3
-(id)initSS1 NS_DESIGNATED_INITIALIZER; // expected-note 2 {{method marked as designated initializer of the class here}}
@end
-@implementation SS3
+@implementation SS3 // expected-warning {{method override for the designated initializer of the superclass '-initS1' not found}}
-(id)initSS1 { // expected-warning {{designated initializer missing a 'super' call to a designated initializer of the super class}}
return [super initB1]; // expected-warning {{designated initializer invoked a non-designated initializer}}
}
@@ -150,7 +151,8 @@ __attribute__((objc_root_class))
-(id)initS4;
@end
-@implementation S6
+@implementation S6 // expected-warning {{method override for the designated initializer of the superclass '-initB1' not found}} \
+ // expected-warning {{method override for the designated initializer of the superclass '-initB3' not found}}
-(id)initS1 {
return [super initB1];
}
OpenPOWER on IntegriCloud