diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-03-04 01:03:41 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-03-04 01:03:41 +0000 |
commit | 0498247f87ea0d716e0c2931fea812280649e33d (patch) | |
tree | 060bbefa6193717fb180978893214dfbaa9e3250 /test/SemaCXX/array-bounds.cpp | |
parent | 0266aa37802a486e65f9259014bb60848fc4be23 (diff) |
Correctly handle nested switch statements in CFGBuilder when on switch statement has a condition that evaluates to a constant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126977 91177308-0d34-0410-b5e6-96231b3b80d8
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: ; + } + } +} + |