Bug 4374 – Required do-while ending semicolon

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-06-23T04:42:00Z
Last change time
2014-08-31T08:17:46Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-06-23T04:42:34Z
This code compiles with v2.047, but the do-while misses the ending semicolon: void main() { do { } while (false) } Turning this kind of code into a syntax error makes this syntax more consistent with the other parts of D syntax and can reduce programmer's confusion (because the semicolon clearly denotes the end of something instead of a possible start of a new while loop). I prefer a language that doesn't need ending semicolons, but in D2 requiring a semicolon there is better.
Comment #1 by timon.gehr — 2011-09-08T16:17:22Z
Comment #2 by timon.gehr — 2011-11-09T00:09:42Z
Comment #3 by yebblies — 2014-08-30T17:01:02Z
Comment #4 by github-bugzilla — 2014-08-31T08:17:46Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c59ca10f14c9e96fd7c9ab0ae53c242c4622ff47 Fix Issue 4374 - Required do-while ending semicolon Deprecation -> Error https://github.com/D-Programming-Language/dmd/commit/8d7b4d13e71e50769f27bad64eeaf6a9dec7f197 Merge pull request #3929 from yebblies/issue4374 Issue 4374 - Required do-while ending semicolon