[Issue 23927] New: Missing unreachable warning after call to a noreturn function as if-condition
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu May 18 22:03:00 UTC 2023
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 at puremagic.com
Reporter: b2.temp at 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.
--
More information about the Digitalmars-d-bugs
mailing list