[clang] 20f7b5f - [Clang] Test case for -Wunused-but-set-variable, warn for volatile.
George Burgess IV via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 14 10:27:50 PDT 2021
Author: Michael Benfield
Date: 2021-06-14T10:25:59-07:00
New Revision: 20f7b5f3f9c8ebbbe7bf6648c824b815385d4bf7
URL: https://github.com/llvm/llvm-project/commit/20f7b5f3f9c8ebbbe7bf6648c824b815385d4bf7
DIFF: https://github.com/llvm/llvm-project/commit/20f7b5f3f9c8ebbbe7bf6648c824b815385d4bf7.diff
LOG: [Clang] Test case for -Wunused-but-set-variable, warn for volatile.
Differential Revision: https://reviews.llvm.org/D103623
Added:
Modified:
clang/test/Sema/warn-unused-but-set-variables.c
Removed:
################################################################################
diff --git a/clang/test/Sema/warn-unused-but-set-variables.c b/clang/test/Sema/warn-unused-but-set-variables.c
index 93595a251df0..a8d05243321f 100644
--- a/clang/test/Sema/warn-unused-but-set-variables.c
+++ b/clang/test/Sema/warn-unused-but-set-variables.c
@@ -23,6 +23,10 @@ int f0() {
int a;
w = (a = 0);
+ // Following gcc, warn for a volatile variable.
+ volatile int b; // expected-warning{{variable 'b' set but not used}}
+ b = 0;
+
int x;
x = 0;
return x;
More information about the cfe-commits
mailing list