summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/warn-unused-variables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/warn-unused-variables.cpp')
-rw-r--r--test/SemaCXX/warn-unused-variables.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-unused-variables.cpp b/test/SemaCXX/warn-unused-variables.cpp
index 6992cdc..8ae7d6a 100644
--- a/test/SemaCXX/warn-unused-variables.cpp
+++ b/test/SemaCXX/warn-unused-variables.cpp
@@ -59,3 +59,9 @@ namespace PR6948 {
X<char> str (read_from_file()); // expected-error{{use of undeclared identifier 'read_from_file'}}
}
}
+
+void unused_local_static() {
+ static int x = 0;
+ static int y = 0; // expected-warning{{unused variable 'y'}}
+#pragma unused(x)
+}
OpenPOWER on IntegriCloud