Building the following code, I get an incorrect warning. int test() { loop: do { break loop; } while(false); return 0; // isn't unreachable. } ----------------------------------- Warning: statement is not reachable D1 does not warn.
No warning given with dmd 2.065, or earlier at 2.061.
No. '-w' option is required to reproduce, I've missed it. Anyway, I change the Severity to minor.
The same bug without label (see bug 13201): ------------------------------ void foo() { } void main() { while (true) { do { foo; break; } while (true); break; } }
I hit this again. The bug seems a careless bit operation. Location: statement.d Statement.blockExit() BlockExit.visit(DoStatement) Code: if (result == BEbreak) // '==' should be '&' ... if (result & BEcontinue) ... I wanted to make a PR, but I don't see how the other flags work.
We have removed the unreachable statement warning https://github.com/dlang/dmd/pull/15568 I think this should be closed.
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17549 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB