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 | 527fa4f24fa885c063730b0c2956019dc0f35a95 (patch) | |
tree | f3fac8eba3b65c94031b21361e8a0da1a4f01c9b /clang/test/SemaCXX/switch-implicit-fallthrough.cpp | |
parent | eb03ae268e60b8966feb6df052b78f9866fc886a (diff) | |
download | bcm5719-llvm-527fa4f24fa885c063730b0c2956019dc0f35a95.tar.gz bcm5719-llvm-527fa4f24fa885c063730b0c2956019dc0f35a95.zip |
Fixed segmentation fault when a CFGBlock has NULL successor.
llvm-svn: 174182
Diffstat (limited to 'clang/test/SemaCXX/switch-implicit-fallthrough.cpp')
-rw-r--r-- | clang/test/SemaCXX/switch-implicit-fallthrough.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/switch-implicit-fallthrough.cpp b/clang/test/SemaCXX/switch-implicit-fallthrough.cpp index 912b21ebfdb..bc94c9e7507 100644 --- a/clang/test/SemaCXX/switch-implicit-fallthrough.cpp +++ b/clang/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}} |