[Bug c++/107571] Missing fallthrough attribute diagnostics

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Wed Nov 9 00:36:49 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107571

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Tue, 8 Nov 2022, jakub at gcc dot gnu.org via Gcc-bugs wrote:

> And looking at the C wording in n2596.pdf, seems it is different again:

That's a very old version.  N3054 is the most recent public draft (SC22 
N5777 is more recent than that and is the actual CD ballot text).

> "The next block item(6.8.2) that would be encountered after a fallthrough
> declaration shall be a case label or default label associated with the smallest
> enclosing switch statement."

It's not exactly clear what "next block item" is for any of the examples 
you give - next lexically (OK once the current one is exited) or in 
execution (no good for a Constraint)?  And thus not clear that any of 
these are invalid.  I've noted that the inconsistency with C++ should be 
raised in an NB comment.


More information about the Gcc-bugs mailing list