[cfe-commits] [PATCH] Implicit fall-through between switch labels

Chandler Carruth chandlerc at google.com
Sat Apr 21 15:26:25 PDT 2012


On Sat, Apr 21, 2012 at 11:00 AM, Matthieu Monrocq <
matthieu.monrocq at gmail.com> wrote:

> Two remarks:
>
> > if there is no statement between two cases, then fallthrough is most
> probable
> > otherwise it is not possible to actually distinguish between a possible
> fallthrough or break
>
> I don't think that providing a fixit is reasonable, because fixit should
> be provided only when they are right, taking chances is risking
> miscompilation.
>

Note that these are fixit hints on *notes* attached to the diagnostic.
Those are never automatically applied, they always require user action to
apply them.

Also, I think that its important to provide the "insert [[fallthrough]]"
fixit because it preserves the existing semantics, right or wrong.
Optionally providing a second fixit hint (still attached to a note!) also
seems fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120421/21957491/attachment.html>


More information about the cfe-commits mailing list