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

          Issue ID: 23266
           Summary: Dead else blocks are not considered unreachable
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

This code, built with -w, gives a "statement is not reachable" warning on the
second return:

void main() {
    if (true) return;
    return;
}

This code does not:

void main() {
    if (true) return;
    else return;
}

This despite the else block being just as unreachable.

--

Reply via email to