summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r--clang/test/SemaObjC/attr-deprecated.m2
-rw-r--r--clang/test/SemaObjC/method-attributes.m22
2 files changed, 23 insertions, 1 deletions
diff --git a/clang/test/SemaObjC/attr-deprecated.m b/clang/test/SemaObjC/attr-deprecated.m
index 52f654ab5d7..3741510e113 100644
--- a/clang/test/SemaObjC/attr-deprecated.m
+++ b/clang/test/SemaObjC/attr-deprecated.m
@@ -9,7 +9,7 @@
@implementation A
+ (void)F __attribute__((deprecated))
-{
+{ // expected-warning {{method attribute may be specified on method declarations only}}
[self F]; // no warning, since the caller is also deprecated.
}
diff --git a/clang/test/SemaObjC/method-attributes.m b/clang/test/SemaObjC/method-attributes.m
index 003cea4bd70..354950c49c7 100644
--- a/clang/test/SemaObjC/method-attributes.m
+++ b/clang/test/SemaObjC/method-attributes.m
@@ -8,3 +8,25 @@
-(void) m0 __attribute__((noreturn));
-(void) m1 __attribute__((unused));
@end
+
+
+@interface INTF
+- (int) foo1: (int)arg1 __attribute__((deprecated));
+
+- (int) foo: (int)arg1;
+
+- (int) foo2: (int)arg1 __attribute__((deprecated)) __attribute__((unavailable));
+@end
+
+@implementation INTF
+- (int) foo: (int)arg1 __attribute__((deprecated)){ // expected-warning {{method attribute may be specified}}
+ return 10;
+}
+- (int) foo1: (int)arg1 {
+ return 10;
+}
+- (int) foo2: (int)arg1 __attribute__((deprecated)) { // expected-warning {{method attribute may be specified}}
+ return 10;
+}
+@end
+
OpenPOWER on IntegriCloud