From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/SemaObjC/special-dep-unavail-warning.m | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 clang/test/SemaObjC/special-dep-unavail-warning.m (limited to 'clang/test/SemaObjC/special-dep-unavail-warning.m') diff --git a/clang/test/SemaObjC/special-dep-unavail-warning.m b/clang/test/SemaObjC/special-dep-unavail-warning.m new file mode 100644 index 0000000..754bf5f --- /dev/null +++ b/clang/test/SemaObjC/special-dep-unavail-warning.m @@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// rdar://8769853 + +@interface B +- (void) depInA; +- (void) unavailMeth __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} +- (void) depInA1 __attribute__((deprecated)); +- (void) unavailMeth1; +- (void) depInA2 __attribute__((deprecated)); +- (void) unavailMeth2 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} +- (void) depunavailInA; +- (void) depunavailInA1 __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} +- (void)FuzzyMeth __attribute__((deprecated)); +- (void)FuzzyMeth1 __attribute__((unavailable)); +@end + +@interface A +- (void) unavailMeth1 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} +- (void) depInA __attribute__((deprecated)); +- (void) depInA2 __attribute__((deprecated)); +- (void) depInA1; +- (void) unavailMeth2 __attribute__((unavailable)); +- (void) depunavailInA __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}} +- (void) depunavailInA1; +- (void)FuzzyMeth __attribute__((unavailable)); +- (void)FuzzyMeth1 __attribute__((deprecated)); +@end + + +@class C; // expected-note 5 {{forward declaration of class here}} + +void test(C *c) { + [c depInA]; // expected-warning {{'depInA' maybe deprecated because receiver type is unknown}} + [c unavailMeth]; // expected-warning {{'unavailMeth' maybe unavailable because receiver type is unknown}} + [c depInA1]; // expected-warning {{'depInA1' maybe deprecated because receiver type is unknown}} + [c unavailMeth1]; // expected-warning {{'unavailMeth1' maybe unavailable because receiver type is unknown}} + [c depInA2]; // expected-warning {{'depInA2' maybe deprecated because receiver type is unknown}} + [c unavailMeth2]; // expected-warning {{'unavailMeth2' maybe unavailable because receiver type is unknown}} + [c depunavailInA]; // expected-warning {{'depunavailInA' maybe unavailable because receiver type is unknown}} + [c depunavailInA1];// expected-warning {{'depunavailInA1' maybe unavailable because receiver type is unknown}} + [c FuzzyMeth]; // expected-warning {{'FuzzyMeth' maybe deprecated because receiver type is unknown}} + [c FuzzyMeth1]; // expected-warning {{'FuzzyMeth1' maybe deprecated because receiver type is unknown}} + +} + +// rdar://10268422 +__attribute ((deprecated)) +@interface DEPRECATED ++(id)new; +@end + +void foo() { + [DEPRECATED new]; // expected-warning {{'DEPRECATED' is deprecated}} +} + -- cgit v1.2.3