[dmd-internals] dmd commit, revision 707
Walter Bright
walter at digitalmars.com
Fri Oct 8 09:22:21 PDT 2010
Brad Roberts wrote:
>
> Error, not warning.
>
> I was curious enough to do some digging. Here's the relevant snippet.. quite
> possibly not a direct quote, but repeated several times across several different
> websites.
>
> ============
> The reason is that such jump is a scoping violation. C++ standard paragraph 6.7.3:
>
> It is possible to transfer into a block, but not in a way that bypasses
> declarations with initialization. A program that jumps (77) from a point where a
> local variable with automatic storage duration is not in scope to a point where
> it is in scope is ill-formed unless the variable has POD type (3.9) and is
> declared without an initializer (8.5).
>
> 77) The transfer from the condition of a switch statement to a case label is
> considered a jump in this respect.
> ============
>
> So, based on that, it's neither spurious nor a bug in gcc. That dmd accepts it
> seems to be a bug. :)
>
>
Except that there is no possible way any jump or case statement can
bypass the initialization of peekt and refer to it.
More information about the dmd-internals
mailing list