www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2850] New: bad codegen for struct static initializers

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2850

           Summary: bad codegen for struct static initializers
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: clugdbug yahoo.com.au


This assert fails at runtime. The initialization doesn't happen.
Struct literals work. Also "enum Test test = { 714 }; " works.

-----
struct Test{
 int foo;
}

enum Test test = { foo:714 };

void main(){
assert(test.foo == 714);
}


-- 
Apr 17 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2850


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from Don <clugdbug yahoo.com.au> 2011-07-06 08:07:11 PDT ---
https://github.com/D-Programming-Language/dmd/commit/0af590ebfd1aa1f0994828b1eb666db89d451e4b

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