[Issue 11977] New: Regression 2.065.b1: goto skips declaration of variable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 23 05:17:55 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11977

           Summary: Regression 2.065.b1: goto skips declaration of
                    variable
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: doob at me.com


--- Comment #0 from Jacob Carlborg <doob at me.com> 2014-01-23 05:17:53 PST ---
This code used to compile with DMD 2.064.2:

void main()
{
    int i;

    switch (i)
    {
        case 1:
            goto Lno_consume; // Line 10
        break;
        default:
    }

    int x; // Line 15
    for (int* tp = &x, tp_end = tp + 3; tp < tp_end; ++tp) { }
    Lno_consume: {}
}

But fails to compile with 2.065.b1 wit this error message:

Error: goto skips declaration of variable main.main.x at main.d(15)

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


More information about the Digitalmars-d-bugs mailing list