summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2019-05-03 07:19:46 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2019-05-03 07:19:46 +0000
commit8cd01e69d8eeb322605c0a30a165b79f06daf63d (patch)
treeffa3c999babcc8435a16fc92a2c1dfc1edd25a25 /clang/test/SemaObjC
parentd724360695d60387148df53b010bf41f07d5e747 (diff)
downloadbcm5719-llvm-8cd01e69d8eeb322605c0a30a165b79f06daf63d.tar.gz
bcm5719-llvm-8cd01e69d8eeb322605c0a30a165b79f06daf63d.zip
[Sema][ObjC] Disable -Wunused-parameter for ObjC methods
The warning isn't very useful when the function is an ObjC method. rdar://problem/41561853 Differential Revision: https://reviews.llvm.org/D61147 llvm-svn: 359864
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r--clang/test/SemaObjC/method-unused-attribute.m8
-rw-r--r--clang/test/SemaObjC/unused.m2
2 files changed, 7 insertions, 3 deletions
diff --git a/clang/test/SemaObjC/method-unused-attribute.m b/clang/test/SemaObjC/method-unused-attribute.m
index d604c3975c8..d8e9659b51c 100644
--- a/clang/test/SemaObjC/method-unused-attribute.m
+++ b/clang/test/SemaObjC/method-unused-attribute.m
@@ -1,5 +1,9 @@
// RUN: %clang_cc1 -fsyntax-only -Wunused-parameter -verify -Wno-objc-root-class %s
+// -Wunused-parameter ignores ObjC method parameters that are unused.
+
+// expected-no-diagnostics
+
@interface INTF
- (void) correct_use_of_unused: (void *) notice : (id)another_arg;
- (void) will_warn_unused_arg: (void *) notice : (id)warn_unused;
@@ -9,7 +13,7 @@
@implementation INTF
- (void) correct_use_of_unused: (void *) __attribute__((unused)) notice : (id) __attribute__((unused)) newarg{
}
-- (void) will_warn_unused_arg: (void *) __attribute__((unused)) notice : (id)warn_unused {} // expected-warning {{unused parameter 'warn_unused'}}
-- (void) unused_attr_on_decl_ignored: (void *) will_warn{} // expected-warning {{unused parameter 'will_warn'}}
+- (void) will_warn_unused_arg: (void *) __attribute__((unused)) notice : (id)warn_unused {}
+- (void) unused_attr_on_decl_ignored: (void *) will_warn{}
@end
diff --git a/clang/test/SemaObjC/unused.m b/clang/test/SemaObjC/unused.m
index f31e4709f53..088f5b45777 100644
--- a/clang/test/SemaObjC/unused.m
+++ b/clang/test/SemaObjC/unused.m
@@ -33,7 +33,7 @@ void test2() {
// 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}} \
+(int)y: // 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; }
OpenPOWER on IntegriCloud