www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16292] New: [REG2.069] bogus "Error: goto skips declaration

https://issues.dlang.org/show_bug.cgi?id=16292

          Issue ID: 16292
           Summary: [REG2.069] bogus "Error: goto skips declaration of
                    variable"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ag0aep6g gmail.com

void main()
{
    goto label; /* Error: goto skips declaration of variable test.main.__dop51
at test.d(4) */
    if (makeS()[0]) /* line 4 */
    {
        label:
    }
}

S makeS() { return S(); }

struct S
{
    int opIndex(size_t i) { return 0; }
}

--
Jul 18 2016