diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2014-02-27 02:43:25 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2014-02-27 02:43:25 +0000 |
commit | cdf1108b613975282b225224d4cb2bda81dc7fa4 (patch) | |
tree | 2ae8daf5f1c96e01cea5eeb300538aae4f21862d /clang/test/SemaCXX/switch-implicit-fallthrough.cpp | |
parent | c204c130fabdffa131d487ec1c701fc95dba0ffe (diff) | |
download | bcm5719-llvm-cdf1108b613975282b225224d4cb2bda81dc7fa4.tar.gz bcm5719-llvm-cdf1108b613975282b225224d4cb2bda81dc7fa4.zip |
As of r202325, CFGBlock predecessors may be NULL. Ignore such preds. Fixes a crasher, PR18983.
llvm-svn: 202340
Diffstat (limited to 'clang/test/SemaCXX/switch-implicit-fallthrough.cpp')
-rw-r--r-- | clang/test/SemaCXX/switch-implicit-fallthrough.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/switch-implicit-fallthrough.cpp b/clang/test/SemaCXX/switch-implicit-fallthrough.cpp index d7959238c6b..831324a64e9 100644 --- a/clang/test/SemaCXX/switch-implicit-fallthrough.cpp +++ b/clang/test/SemaCXX/switch-implicit-fallthrough.cpp @@ -265,3 +265,16 @@ void fallthrough_in_local_class() { }; } +namespace PR18983 { + void fatal() __attribute__((noreturn)); + int num(); + void test() { + switch (num()) { + case 1: + fatal(); + // Don't issue a warning. + case 2: + break; + } + } +} |