[Bug 158] New: immutable vector incorrectly initialized from static constructor

via D.gnu d.gnu at puremagic.com
Sat Sep 6 16:57:23 PDT 2014


http://bugzilla.gdcproject.org/show_bug.cgi?id=158

            Bug ID: 158
           Summary: immutable vector incorrectly initialized from static
                    constructor
           Product: GDC
           Version: 4.9.x
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw at gdcproject.org
          Reporter: vicencb at gmail.com

This code:

import std.stdio;
immutable int[] int_vector;
static this() { int_vector = [4]; }
void main() { writeln(int_vector); }

Compiled with gdc and executed:
gdc test.d && ./a.out

Prints:
[1]

Compiled with dmd and executed:
dmd test.d && ./gdc_bug

Prints:
[4]

Tested with branch gdc-4.9 commit e748df611430b497e6147309fbec4aad11e4ae26

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20140906/28a7495c/attachment.html>


More information about the D.gnu mailing list