Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.
This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73797 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjC/warn-unused-parameters.m b/test/SemaObjC/warn-unused-parameters.m
new file mode 100644
index 0000000..618dc3f
--- /dev/null
+++ b/test/SemaObjC/warn-unused-parameters.m
@@ -0,0 +1,11 @@
+// RUN: clang -fsyntax-only -Wunused -Xclang -verify %s
+
+@interface foo
+- (int)meth: (int)x: (int)y: (int)z ;
+@end
+
+@implementation foo
+- (int) meth: (int)x:
+ (int)y: // expected-warning{{unused}}
+ (int) __attribute__((unused))z { return x; }
+@end