summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/no-warn-unused-const-variables.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-09-11 10:37:35 +0000
committerDaniel Jasper <djasper@google.com>2013-09-11 10:37:35 +0000
commitc531daefd9cc627c8c348eee1547273660a1e3c5 (patch)
tree75cc05d4ecf835d07154c8b1ebc9e9e1dfeb30fe /clang/test/SemaCXX/no-warn-unused-const-variables.cpp
parentfa5ab1c8563843f0d05cccd43822e84ea8df2394 (diff)
downloadbcm5719-llvm-c531daefd9cc627c8c348eee1547273660a1e3c5.tar.gz
bcm5719-llvm-c531daefd9cc627c8c348eee1547273660a1e3c5.zip
Split -Wunused-variable warning.
With r190382, -Wunused-variable warns about unused const variables when appropriate. For codebases that use -Werror, this poses a problem as existing unused const variables need to be cleaned up first. To make the transistion easier, this patch splits -Wunused-variable by pulling out an additional -Wunused-const-variable (by default activated along with -Wunused-variable). llvm-svn: 190508
Diffstat (limited to 'clang/test/SemaCXX/no-warn-unused-const-variables.cpp')
-rw-r--r--clang/test/SemaCXX/no-warn-unused-const-variables.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/no-warn-unused-const-variables.cpp b/clang/test/SemaCXX/no-warn-unused-const-variables.cpp
new file mode 100644
index 00000000000..c146ca04f83
--- /dev/null
+++ b/clang/test/SemaCXX/no-warn-unused-const-variables.cpp
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wno-unused-const-variable -verify %s
+
+namespace {
+ int i = 0; // expected-warning {{unused variable 'i'}}
+ const int j = 0;;
+}
OpenPOWER on IntegriCloud