[clang] d90a3fc - [Clang] Added testcases for -Wunused-but-set-parameter
Dávid Bolvanský via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 23 14:14:45 PDT 2022
Author: Dávid Bolvanský
Date: 2022-03-23T22:14:38+01:00
New Revision: d90a3fcacda7257b26ac32350353410f79be6d2b
URL: https://github.com/llvm/llvm-project/commit/d90a3fcacda7257b26ac32350353410f79be6d2b
DIFF: https://github.com/llvm/llvm-project/commit/d90a3fcacda7257b26ac32350353410f79be6d2b.diff
LOG: [Clang] Added testcases for -Wunused-but-set-parameter
Clang now emits warnings for them after D122271 (shared logic with -Wunused-but-set-variable)
Added:
Modified:
clang/test/Sema/warn-unused-but-set-parameters.c
Removed:
################################################################################
diff --git a/clang/test/Sema/warn-unused-but-set-parameters.c b/clang/test/Sema/warn-unused-but-set-parameters.c
index 4da4822090f3d..f1563ab50c1fb 100644
--- a/clang/test/Sema/warn-unused-but-set-parameters.c
+++ b/clang/test/Sema/warn-unused-but-set-parameters.c
@@ -24,3 +24,11 @@ void f3(struct S s) { // expected-warning{{parameter 's' set but not used}}
struct S t;
s = t;
}
+
+void f4(int j) { // expected-warning{{parameter 'j' set but not used}}
+ j++;
+}
+
+void f5(int k) { // expected-warning{{parameter 'k' set but not used}}
+ --k;
+}
More information about the cfe-commits
mailing list