On 2/12/26 18:48, Joseph Myers wrote:
On Thu, 12 Feb 2026, Jørgen Kvalsvik wrote:
Joseph, any thoughts on the frontend changes? What about Andrew's concern with
As far as I know this new feature was first posted outside development
stage 1. I advise reposting after GCC 16 has branched when new features
can be considered again.
I suppose, I'll rebase and repost when the window opens again in the
spring. That being said, if I need to make (substantial) changes I'd
like to do them sooner rather than later, so it's easier to keep up.
On that note, I think it might be a good idea for [[disable_coverage]]
to also imply [[fallthrough]] when used with a label, for when we don't
want to count it. Consider:
switch (k)
{
... // all cases handled
[[gnu::disable_coverage]] // Warns -Wfallthrough
default:
[[gnu::disable_coverage]]
__builtin_unreachable();
}
We can't do [[gnu::disable_coverage]][[fallthrough]]; because then
disable_coverage would apply to the [[fallthrough]], not the label:
switch (k)
{
... // all cases handled
[[gnu::disable_coverage]] [[fallthrough]]; // no warning
default: // counts for coverage
[[gnu::disable_coverage]]
__builtin_unreachable();
}
The code is actually quite simple, either check the gimple stream for
the fallthrough and count one statement more, or check if the next token
is a case/default label and insert the fallthrough ifn. The question is,
is this behaviour we want?
Thanks,
Jørgen