D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4100 - Break and continue to label should mention foreach
Summary: Break and continue to label should mention foreach
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL: http://digitalmars.com/d/2.0/statemen...
Keywords: spec
Depends on:
Blocks:
 
Reported: 2010-04-17 10:55 UTC by Jerry Quinn
Modified: 2014-02-15 02:43 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jerry Quinn 2010-04-17 10:55:19 UTC
Both break and continue can branch to a label, but the text only mentions for, while, and do loops.  Foreach loops should also be included.  Dmd supports it.
Comment 1 Ellery Newcomer 2010-04-17 12:24:56 UTC
(In reply to comment #0)
> Both break and continue can branch to a label, but the text only mentions for,
> while, and do loops.  Foreach loops should also be included.  Dmd supports it.

It's mentioned just above the switch statement
Comment 2 Jerry Quinn 2010-04-17 13:27:29 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Both break and continue can branch to a label, but the text only mentions for,
> > while, and do loops.  Foreach loops should also be included.  Dmd supports it.
> 
> It's mentioned just above the switch statement

The text for ContinueStatement is:

If continue is followed by Identifier, the Identifier must be the label of an enclosing while, for, or do loop, and the next iteration of that loop is executed. It is an error if there is no such statement.

It doesn't mention foreach and it should.  Ditto with BreakStatement.
Comment 3 Walter Bright 2010-05-05 10:56:28 UTC
changeset 1497
Comment 4 Don 2010-05-18 12:18:59 UTC
Fixed DMD1.061 and DMD2.046.