[Issue 23266] Dead else blocks are not considered unreachable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 22 07:59:30 UTC 2022


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

--- Comment #2 from FeepingCreature <default_357-line at yahoo.de> ---
I've tried a DMD branch that errors with -w if `if()` has a statically known
true condition and an else block. The two main things I ran into in Phobos are:

1.
if (false) {
  some code that should affect function attributes but never be run; 
}

2.
if (...) that should be static if (...)

For one the warning is useful, for the other it's harmful...

--


More information about the Digitalmars-d-bugs mailing list