aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-ssa-sprintf.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2018-02-20 11:11:31 +0000
committerSiddhesh Poyarekar <siddhesh@gcc.gnu.org>2018-02-20 11:11:31 +0000
commitd3eb902f7f45cc20b5802b2ef3c85b88fdec52c0 (patch)
treed2a38f0b7b33dc609127d7b35d5e8333ffcf2b21 /gcc/gimple-ssa-sprintf.c
parent5bbccd92506c4d260eca29d12fa30c75aaaee65b (diff)
downloadgcc-d3eb902f7f45cc20b5802b2ef3c85b88fdec52c0.zip
gcc-d3eb902f7f45cc20b5802b2ef3c85b88fdec52c0.tar.gz
gcc-d3eb902f7f45cc20b5802b2ef3c85b88fdec52c0.tar.bz2
c++: Fix spurious fallthrough warning on break
The C++ frontend generates a break that results in the fallthrough warning misfiring in nested switch blocks where cases in the inner switch block return, rendering the break pointless. The fallthrough detection in finish_break_stmt does not work either because the condition is encoded as an IF_STMT and not a COND_EXPR. Fix this by adding a condition for IF_STMT in the langhooks.block_may_fallthru for C++. Fix tested on x86_64. gcc/cp * cp-objcp-common.c (cxx_block_may_fallthru): Add case for IF_STMT. gcc/testsuite * g++.dg/nested-switch.C: New test case. From-SVN: r257843
Diffstat (limited to 'gcc/gimple-ssa-sprintf.c')
0 files changed, 0 insertions, 0 deletions