www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13858] New: Wrong warning about unreachable code with


          Issue ID: 13858
           Summary: Wrong warning about unreachable code with break/goto
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: andrej.mitrovich gmail.com

void foo() { assert(0); }

void main()
    int x = 0;

    LSwitch: switch (x)
        case 0:
            break LSwitch;

        default: return;


$ dmd -w -run test.d
 test.d(15): Warning: statement is not reachable
However the above isn't true: $ dmd -run test.d
 core.exception.AssertError test.d(1): Assertion failure
Dec 12 2014