May 18, 2023 [Issue 23927] New: Missing unreachable warning after call to a noreturn function as if-condition | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23927 Issue ID: 23927 Summary: Missing unreachable warning after call to a noreturn function as if-condition Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: accepts-invalid, diagnostic Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: b2.temp@gmx.com The following code compiles without warning ``` alias NR = typeof(assert(0)); NR test(){assert(0);} void main() { if (test()) { } return; } ``` but there should be one on the ReturnStatement located in `main` because it is not reachable. The same problem can be observed if the IfStatement is replaced with a WhileStatement. -- |
Copyright © 1999-2021 by the D Language Foundation