[dmd-internals] dmd commit, revision 707
Brad Roberts
braddr at puremagic.com
Thu Oct 7 23:49:51 PDT 2010
On 10/7/2010 10:35 PM, dsource.org wrote:
> dmd commit, revision 707
>
>
> user: walter
>
> msg:
> fix gcc spurious warning
>
> http://www.dsource.org/projects/dmd/changeset/707
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. :)
Later,
Brad
More information about the dmd-internals
mailing list