On Tue, 26 Aug 2025, Anna (navi) Figueiredo Gomes wrote:

> this is similar to the failure test `i ()` in gcc/testsuite/gcc.dg/defer-2.c,
> and the technical specification covers such case:
> 
> > 6.4:
> > Constraints:
> >     Jumps by means of goto in E shall not jump over a defer statement in E.
> 
> for a rationale, i don't quite see one in the ts itself, but for myself,
> i'd say it makes sense, as otherwise we'd need to either execute the
> deferred block when jumping back, or allow it to be reached multiple
> times while only executing on scope exit proper, both behaviours can
> seem unintuitive, depending on user expectation

The question being discussed on the reflector is whether "jump over" is 
meant to cover this case, or whether exactly the same jumps should be 
disallowed as are disallowed into the scope of an identifier with variably 
modified type.

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to