This is an archive of the discontinued LLVM Phabricator instance.

-Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in unreachable code" was issued incorrectly.
ClosedPublic

Authored by alexfh on Feb 5 2013, 9:00 PM.

Details

Summary

-Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in unreachable code" was issued incorrectly:

  1. In actual unreachable code, but not immediately on a fall-through execution

path "fallthrough annotation does not directly precede switch label" is better;

  1. After default: in a switch with covered enum cases. Actually, these shouldn't

be treated as unreachable code for our purpose.

Diff Detail

Event Timeline

alexfh updated this revision to Unknown Object (????).Feb 6 2013, 6:03 PM

Treat all cases as reachable (fixes a long known problem with switching on constants).

rsmith accepted this revision.Feb 6 2013, 6:09 PM

Makes sense, LGTM

test/SemaCXX/switch-implicit-fallthrough.cpp
202–205

We can drop these comments now.

alexfh closed this revision.Feb 6 2013, 6:18 PM