[Issue 3264] New: -O causes wrong "used before set" error when using enum.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 25 05:01:40 PDT 2009


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

           Summary: -O causes wrong "used before set" error when using
                    enum.
           Product: D
           Version: 2.031
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: clugdbug at yahoo.com.au


OK when compiled normally, but when compiled with -O, generates:
interpret.d(2367): Error: variable Q used before set

--------

void bug()
{
    enum int Q=0;
    string [2] s = ["a", "b"];    
    assert(s[Q].dup=="a");
}

-- 
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