[Issue 6683] Skipping declaration with goto resulted in nonsense

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 26 14:12:30 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6683


Stewart Gordon <smjg at iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
                 CC|                            |smjg at iname.com


--- Comment #5 from Stewart Gordon <smjg at iname.com> 2011-10-26 14:11:20 PDT ---
(In reply to comment #1)
> The spec says "It is illegal for a GotoStatement to be used to skip
> initializations.". (
> http://www.d-programming-language.org/statement.html#GotoStatement )
> 
> According to the glossary
> (http://www.d-programming-language.org/glossary.html), "A code construct is
> illegal if it does not conform to the D language specification. This may be
> true even if the compiler or runtime fails to detect the error."

For all I know, that probably means "This may be true even if some compiler,
because of a bug in it, fails to detect the error."

> So the compiler is free to ignore illegal code.

Which is the bit of illegal code - the goto statement or the declaration it
skips?  In my experience, the compiler doesn't ignore either.

Moreover, why does the spec bother to forbid anything if compiler writers are
free to ignore it all?

> A future compiler, potentially
> not dmd, may indeed flag it as a compile-time error, so any behavior caused by
> illegal code should be regarded as unpredictable and unreliable.

So you're claiming all accepts-invalid bugs are really enhancement requests?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list