www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 158] New: immutable vector incorrectly initialized from static

Date: Sun, 7 Sep 2014 00:57:23 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"


            Bug ID: 158
           Summary: immutable vector incorrectly initialized from static
           Product: GDC
           Version: 4.9.x
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw gdcproject.org
          Reporter: vicencb 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


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


Tested with branch gdc-4.9 commit e748df611430b497e6147309fbec4aad11e4ae26

You are receiving this mail because:
You are watching all bug changes.
Sep 06 2014