From 5a29e6aadb0eba1523f7f6ba36260bab3bb0616c Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 5 Nov 2014 23:58:55 +0000 Subject: Patch for small addition to availability attribute. This is to accept "NA" in place of vesion number for availability attribute. Used on introduced=NA to mean unavailable and deprecated=NA to mean nothing (not deprecated). rdar://18804883 llvm-svn: 221417 --- clang/test/SemaObjC/attr-availability-1.m | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'clang/test/SemaObjC') diff --git a/clang/test/SemaObjC/attr-availability-1.m b/clang/test/SemaObjC/attr-availability-1.m index af0fcfe3537..063407adaee 100644 --- a/clang/test/SemaObjC/attr-availability-1.m +++ b/clang/test/SemaObjC/attr-availability-1.m @@ -95,3 +95,22 @@ id NSNibOwner, topNibObjects; - (void)Meth1 __attribute__((availability(macosx,introduced=10.3_0))); // expected-warning {{use same version number separators '_' or '.'}} - (void)Meth2 __attribute__((availability(macosx,introduced=10_3.1))); // expected-warning {{use same version number separators '_' or '.'}} @end + +// rdar://18804883 +@protocol P18804883 +- (void)proto_method __attribute__((availability(macosx,introduced=10_1,deprecated=NA))); // means nothing (not deprecated) +@end + +@interface A18804883 +- (void)interface_method __attribute__((availability(macosx,introduced=NA))); // expected-note {{'interface_method' has been explicitly marked unavailable here}} +- (void)strange_method __attribute__((availability(macosx,introduced=NA,deprecated=NA))); // expected-note {{'strange_method' has been explicitly marked unavailable here}} +- (void) always_available __attribute__((availability(macosx,deprecated=NA))); +@end + +void foo (A18804883* pa) { + [pa interface_method]; // expected-error {{'interface_method' is unavailable: not available on OS X}} + [pa proto_method]; + [pa strange_method]; // expected-error {{'strange_method' is unavailable: not available on OS X}} + [pa always_available]; +} + -- cgit v1.2.3