October 12, 2016
https://issues.dlang.org/show_bug.cgi?id=14835

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #8 from Walter Bright <bugzilla@digitalmars.com> ---
It seems the problem lies here:

https://github.com/dlang/dmd/blob/master/src/statement.d#L453

                if (s.condition.isBool(true))
                {
                    if (s.ifbody)
                        result |= s.ifbody.blockExit(func, mustNotThrow);
                    else
                        result |= BEfallthru;
                }
                else if (s.condition.isBool(false))
                {
                    if (s.elsebody)
                        result |= s.elsebody.blockExit(func, mustNotThrow);
                    else
                        result |= BEfallthru;
                }
                else

Having it set BEfallthru as if both ifbody and elsebody could execute should work, but I wonder about its affect on existing code.

--
October 18, 2016
https://issues.dlang.org/show_bug.cgi?id=14835

--- Comment #9 from anonymous4 <dfj1esp02@sneakemail.com> ---
(In reply to Walter Bright from comment #8)
> but I wonder about its affect on existing code.

Will it disable all unreachable code checks?
Try this:

int square(int num)
{
   if(true)return 0;
   return num * num;
}

--
May 28, 2019
https://issues.dlang.org/show_bug.cgi?id=14835

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei@erdani.com

--- Comment #10 from Andrei Alexandrescu <andrei@erdani.com> ---
One simple possibility here is to automatically insert `else` whenever the `static if` branch does not fall through

--
March 28, 2021
https://issues.dlang.org/show_bug.cgi?id=14835

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Statement is not reachable  |Constant folding should not
                   |doesn't play along generic  |affect front end flow
                   |code                        |analysis

--
March 28, 2021
https://issues.dlang.org/show_bug.cgi?id=14835

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #11 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #12311 "fix Issue 14835 - Constant folding should not affect front end flow a…" fixing this issue:

- fix Issue 14835 - Constant folding should not affect front end flow analysis

https://github.com/dlang/dmd/pull/12311

--
March 29, 2021
https://issues.dlang.org/show_bug.cgi?id=14835

deadalnix <deadalnix@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |deadalnix@gmail.com

--- Comment #12 from deadalnix <deadalnix@gmail.com> ---
(In reply to Andrei Alexandrescu from comment #10)
> One simple possibility here is to automatically insert `else` whenever the `static if` branch does not fall through

This is the most underrated comment of the thread ^

I actually implemented this in SDC, and it makes a HUGE difference.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=14835

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

--
September 21
https://issues.dlang.org/show_bug.cgi?id=14835

--- Comment #13 from Dlang Bot <dlang-bot@dlang.rocks> ---
@adamdruppe updated dlang/dmd pull request #15568 "make D great again" fixing this issue:

- Fix 10532, 14835, 20522 by adding test cases

https://github.com/dlang/dmd/pull/15568

--
October 01
https://issues.dlang.org/show_bug.cgi?id=14835

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #14 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15568 "make D great again" was merged into master:

- cfd7cfd4382803e0252ebe1cf13d4c39a60209e5 by Dennis Korpel:
  Fix 10532, 14835, 20522 by adding test cases

https://github.com/dlang/dmd/pull/15568

--
1 2
Next ›   Last »