aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-04-08 23:39:32 +0000
committerTed Kremenek <kremenek@apple.com>2013-04-08 23:39:32 +0000
commit1db6d6bcfdd3b1a56e154adc6777811295b9a010 (patch)
tree647044c3aa7f912063c1c866d2da27ea5243f5da
parent4b9bcd667776932e9b4c84144a9e7e8d581ffa63 (diff)
Add test case calling a deprecated method from a subclass that reimplements that method gets a warning.
Test case from <rdar://problem/11627873>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179070 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/SemaObjC/attr-availability.m28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/SemaObjC/attr-availability.m b/test/SemaObjC/attr-availability.m
index 5fe2b62d07..fddcd506d4 100644
--- a/test/SemaObjC/attr-availability.m
+++ b/test/SemaObjC/attr-availability.m
@@ -32,3 +32,31 @@ void f(A *a, B *b) {
[a proto_method]; // expected-warning{{'proto_method' is deprecated: first deprecated in OS X 10.2}}
[b proto_method]; // expected-warning{{'proto_method' is deprecated: first deprecated in OS X 10.2}}
}
+
+// Test case for <rdar://problem/11627873>. Warn about
+// using a deprecated method when that method is re-implemented in a
+// subclass where the redeclared method is not deprecated.
+@interface C
+- (void) method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note {{method 'method' declared here}}
+@end
+
+@interface D : C
+- (void) method;
+@end
+
+@interface E : D
+- (void) method;
+@end
+
+@implementation D
+- (void) method {
+ [super method]; // expected-warning {{'method' is deprecated: first deprecated in OS X 10.2}}
+}
+@end
+
+@implementation E
+- (void) method {
+ [super method]; // no-warning
+}
+@end
+