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

           Summary: "variable used before set" with foreach with ref +
                    scope(failure) + structure method + -O
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: thecybersha...@gmail.com


--- Comment #0 from Vladimir <thecybersha...@gmail.com> 2011-05-10 15:38:19 PDT 
---
When compiled with -O: test.d(9): Error: variable b used before set

struct B { void bar(){} }
B[] barr;

void foo()
{
    foreach (ref b; barr)
    {
        scope(failure)
            b.bar();
        assert(&b); // do anything with b
    }
}

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

Reply via email to