[Issue 17831] New: [ICE] Internal error: backend/symbol.c 1039: foreach inside a switch statement

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Sep 16 12:37:41 UTC 2017


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

          Issue ID: 17831
           Summary: [ICE] Internal error: backend/symbol.c 1039: foreach
                    inside a switch statement
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

Taken from recently introduce test case.

https://github.com/dlang/dmd/pull/7120

---
int bug17807(){
    int y=0;
    Lswitch: switch(2){
        { case 0: break; }
        enum x=0;
        struct S{ enum x=0; }
        int foo(){
            return 0;
        }
        default: y=x+S.x+foo();
        foreach(i;1..5)
            case i: break Lswitch;
    }
    return y;
}
---

Removing the 'static' in foreach results in a compiler ICE.

--


More information about the Digitalmars-d-bugs mailing list