[Issue 3005] ill-defined for statement

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 19 10:44:14 PDT 2009


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


Stewart Gordon <smjg at iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|accepts-invalid             |spec




--- Comment #2 from Stewart Gordon <smjg at iname.com>  2009-05-19 10:44:13 PDT ---
(In reply to comment #1)
> That's been known for some time. It's done that way to allow this to work:
> 
> for(int a = 5; a < 10; a++) {}
> ----[statment]
> 
> I think the best "fix" would be to switch from a statement, to allowing an
> expression or declaration.

That's how I thought it was defined - but it turns out

ForStatement:
    for ( Initialize Test ; Increment ) ScopeStatement

Initialize:
    ;
    NoScopeNonEmptyStatement

so I was wrong about this being accepts-invalid.

-- 
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