diff options
Diffstat (limited to 'test/SemaCXX/array-bounds.cpp')
-rw-r--r-- | test/SemaCXX/array-bounds.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaCXX/array-bounds.cpp b/test/SemaCXX/array-bounds.cpp index 5db9c1f6c9..62b4d520cc 100644 --- a/test/SemaCXX/array-bounds.cpp +++ b/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: ; + } + } +} + |