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

           Summary: [CTFE] regression: struct return values wrong if used
                    in array initializer
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: r.sagita...@gmx.de


--- Comment #0 from Rainer Schuetze <r.sagita...@gmx.de> 2011-06-03 10:34:04 
PDT ---
struct S
{
    int a;
}

S initS(int x)
{
    version(works)
        return S(x);
    else
    {
        S s = S(x);
        return s;
    }
}
static const S[2] s2 = [ initS(1), initS(2) ];
static assert(s2[0].a == 1);

fails with the latest version from github with 
test.d(19): Error: static assert  (2 == 1) is false

dmd 2.053 compiles without error. enabling version "works" also works.

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

Reply via email to