[Issue 7880] New: [CTFE] cast from void array allowed with different results than at runtime

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 9 14:18:39 PDT 2012


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

           Summary: [CTFE] cast from void array allowed with different
                    results than at runtime
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at gmx.ch 2012-04-09 14:19:21 PDT ---
DMD 2.058/2.059head

int bar(){
    int[] y = new int[2];
    y[0]=2000000;
    void[] x = y;
    return (cast(byte[])x)[1];                                              
}
static assert(!is(typeof({enum _ = (assert(!bar()),1);}))); // fail

The static assertion should pass.

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


More information about the Digitalmars-d-bugs mailing list