aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/attr-availability.m
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-15 22:43:08 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-15 22:43:08 +0000
commitf4d918fdf7da64215db8abe63945798c66e6d132 (patch)
tree3e7e4638ae49e8361b6d3c3a746b38075a8fb8bd /test/SemaObjC/attr-availability.m
parent041e6aab2f48574009aebfb41ffcb74d00758a1f (diff)
When checking availability attributes for consistency between an
overriding and overridden method, allow the overridden method to have a narrower contract (introduced earlier, deprecated/obsoleted later) than the overriding method. Fixes <rdar://problem/12992023>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjC/attr-availability.m')
-rw-r--r--test/SemaObjC/attr-availability.m13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaObjC/attr-availability.m b/test/SemaObjC/attr-availability.m
index ed6b7608b9..0905733906 100644
--- a/test/SemaObjC/attr-availability.m
+++ b/test/SemaObjC/attr-availability.m
@@ -6,11 +6,24 @@
@interface A <P>
- (void)method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note {{method 'method' declared here}}
+
+- (void)overridden __attribute__((availability(macosx,introduced=10.3))); // expected-note{{overridden method is here}}
+- (void)overridden2 __attribute__((availability(macosx,introduced=10.3)));
+- (void)overridden3 __attribute__((availability(macosx,deprecated=10.3)));
+- (void)overridden4 __attribute__((availability(macosx,deprecated=10.3))); // expected-note{{overridden method is here}}
+- (void)overridden5 __attribute__((availability(macosx,unavailable))); // expected-note{{overridden method is here}}
+- (void)overridden6 __attribute__((availability(macosx,introduced=10.3)));
@end
// rdar://11475360
@interface B : A
- (void)method; // expected-note {{method 'method' declared here}}
+- (void)overridden __attribute__((availability(macosx,introduced=10.4))); // expected-warning{{overriding method introduced after overridden method on OS X (10.4 vs. 10.3)}}
+- (void)overridden2 __attribute__((availability(macosx,introduced=10.2)));
+- (void)overridden3 __attribute__((availability(macosx,deprecated=10.4)));
+- (void)overridden4 __attribute__((availability(macosx,deprecated=10.2))); // expected-warning{{overriding method deprecated before overridden method on OS X (10.3 vs. 10.2)}}
+- (void)overridden5 __attribute__((availability(macosx,introduced=10.3))); // expected-warning{{overriding method cannot be unavailable on OS X when its overridden method is available}}
+- (void)overridden6 __attribute__((availability(macosx,unavailable)));
@end
void f(A *a, B *b) {