July 20, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1356

           Summary: Some parsing issues with struct initializers.
           Product: D
           Version: 1.017
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: aziz.kerim@gmail.com


struct foo { int a = 4; }

static foo f = {a:void,}; // Void initializer allowed in struct initializer. writefln(f.a); // prints 0

// Struct initializer can have any number of leading and trailing commas,
whereas only a trailing one is allowed.
static foo f = {,,,,a:1,,,,};

// Compiler hangs if this is at the end of a file.
static foo f = {


-- 

December 22, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=1356


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug@yahoo.com.au
         Resolution|                            |FIXED


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2011-12-22 00:59:59 PST ---
(In reply to comment #0)
> struct foo { int a = 4; }
> 
> static foo f = {a:void,}; // Void initializer allowed in struct initializer. writefln(f.a); // prints 0

This isn't a bug.

> 
> // Struct initializer can have any number of leading and trailing commas,
> whereas only a trailing one is allowed.
> static foo f = {,,,,a:1,,,,};

Fixed in 2.055 and 1.070.

> 
> // Compiler hangs if this is at the end of a file.
> static foo f = {

Fixed in 1.023.

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