aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/unused.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/unused.m')
-rw-r--r--test/SemaObjC/unused.m27
1 files changed, 23 insertions, 4 deletions
diff --git a/test/SemaObjC/unused.m b/test/SemaObjC/unused.m
index 5c7542bf4738..3fd1cf04673f 100644
--- a/test/SemaObjC/unused.m
+++ b/test/SemaObjC/unused.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -Wunused -Wunused-parameter -fsyntax-only -Wno-objc-root-class %s
+// RUN: %clang_cc1 -verify -Wused-but-marked-unused -Wno-objc-protocol-method-implementation -Wunused -Wunused-parameter -fsyntax-only -Wno-objc-root-class %s
int printf(const char *, ...);
@@ -25,12 +25,17 @@ void test2() {
}
@interface foo
-- (int)meth: (int)x: (int)y: (int)z ;
+- (int)meth: (int)x : (int)y : (int)z ;
@end
@implementation foo
-- (int) meth: (int)x:
-(int)y: // expected-warning{{unused}}
+- (int) meth: (int)x: // expected-warning {{'x' used as the name of the previous parameter rather than as part of the selector}} \
+ // expected-note {{introduce a parameter name to make 'x' part of the selector}} \
+ // expected-note {{or insert whitespace before ':' to use 'x' as parameter name and have an empty entry in the selector}}
+
+(int)y: // expected-warning {{unused}} expected-warning {{'y' used as the name of the previous parameter rather than as part of the selector}} \
+ // expected-note {{introduce a parameter name to make 'y' part of the selector}} \
+ // expected-note {{or insert whitespace before ':' to use 'y' as parameter name and have an empty entry in the selector}}
(int) __attribute__((unused))z { return x; }
@end
@@ -53,3 +58,17 @@ void test2() {
// rdar://10777111
static NSString *x = @"hi"; // expected-warning {{unused variable 'x'}}
+
+// rdar://12233989
+@interface TestTransitiveUnused
+- (void) a __attribute__((unused));
+- (void) b __attribute__((unused));
+@end
+
+@interface TestTransitiveUnused(CAT)
+@end
+
+@implementation TestTransitiveUnused(CAT)
+- (void) b {}
+- (void) a { [self b]; }
+@end