summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/array-bounds.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/array-bounds.cpp')
-rw-r--r--clang/test/SemaCXX/array-bounds.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/array-bounds.cpp b/clang/test/SemaCXX/array-bounds.cpp
index 5db9c1f6c98..62b4d520cc7 100644
--- a/clang/test/SemaCXX/array-bounds.cpp
+++ b/clang/test/SemaCXX/array-bounds.cpp
@@ -147,3 +147,16 @@ void test_switch() {
}
}
+// Test nested switch statements.
+enum enumA { enumA_A, enumA_B, enumA_C, enumA_D, enumA_E };
+enum enumB { enumB_X, enumB_Y, enumB_Z };
+static enum enumB myVal = enumB_X;
+void test_nested_switch()
+{
+ switch (enumA_E) { // expected-warning {{no case matching constant}}
+ switch (myVal) { // expected-warning {{enumeration values 'enumB_X' and 'enumB_Z' not handled in switch}}
+ case enumB_Y: ;
+ }
+ }
+}
+
OpenPOWER on IntegriCloud