diff options
author | Alexander Kornienko <alexfh@google.com> | 2013-02-01 15:39:20 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2013-02-01 15:39:20 +0000 |
commit | 0162b832fd6450cd3a23019a3c900382d0e9415c (patch) | |
tree | 86f0bc941228fbe676a586bc69c7db7de03586b4 /test/SemaCXX/switch-implicit-fallthrough.cpp | |
parent | 57dab7135269ba12b979a91415153d00794c7727 (diff) |
Fixed segmentation fault when a CFGBlock has NULL successor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174182 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/switch-implicit-fallthrough.cpp')
-rw-r--r-- | test/SemaCXX/switch-implicit-fallthrough.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/SemaCXX/switch-implicit-fallthrough.cpp b/test/SemaCXX/switch-implicit-fallthrough.cpp index 912b21ebfd..bc94c9e750 100644 --- a/test/SemaCXX/switch-implicit-fallthrough.cpp +++ b/test/SemaCXX/switch-implicit-fallthrough.cpp @@ -172,6 +172,11 @@ int fallthrough_macro1(int n) { return n; } +void fallthrough_cfgblock_with_null_successor(int x) { + (x && "") ? (void)(0) : (void)(1); + switch (x) {} +} + int fallthrough_position(int n) { switch (n) { [[clang::fallthrough]]; // expected-warning{{fallthrough annotation in unreachable code}} |