Thread overview
[Issue 13165] Using -profile does extra control flow analysis, leading to spurious statement is not reachable warning
[Issue 13165] Spurious "Warning: statement is not reachable" with -profile, If return statement exists in void main()
Jul 20, 2014
sinkuu@aol.jp
Nov 07, 2014
Nick Treleaven
Nov 07, 2014
Nick Treleaven
Jul 03, 2018
Mathias LANG
Jul 03, 2018
Mathias LANG
Aug 01, 2018
Vitali Karabitski
Aug 01, 2018
Vitali Karabitski
Oct 31, 2019
Tobias Pankrath
July 20, 2014
https://issues.dlang.org/show_bug.cgi?id=13165

sinkuu@aol.jp changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Not located "Warning:       |Spurious "Warning:
                   |statement is not reachable" |statement is not reachable"
                   |with -profile, If return    |with -profile, If return
                   |statement exists in void    |statement exists in void
                   |main()                      |main()

--
November 07, 2014
https://issues.dlang.org/show_bug.cgi?id=13165

Nick Treleaven <ntrel-pub@mybtinternet.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ntrel-pub@mybtinternet.com

--- Comment #1 from Nick Treleaven <ntrel-pub@mybtinternet.com> ---
I can't reproduce this with dmd 2.066.0.

--
November 07, 2014
https://issues.dlang.org/show_bug.cgi?id=13165

--- Comment #2 from Nick Treleaven <ntrel-pub@mybtinternet.com> ---
Sorry, I can reproduce it with -profile.

--
July 03, 2018
https://issues.dlang.org/show_bug.cgi?id=13165

Mathias LANG <pro.mathias.lang@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pro.mathias.lang@gmail.com
            Summary|Spurious "Warning:          |Using -profile does extra
                   |statement is not reachable" |control flow analysis,
                   |with -profile, If return    |leading to spurious
                   |statement exists in void    |statement is not reachable
                   |main()                      |warning

--
July 03, 2018
https://issues.dlang.org/show_bug.cgi?id=13165

--- Comment #3 from Mathias LANG <pro.mathias.lang@gmail.com> ---
Renamed the issue, as an extra case was reported here: https://github.com/dlang/phobos/pull/6621#issuecomment-401980976

It seems the compiler is now able to propagate the fact that a function never returns, e.g.:

```
struct S
{
        @trusted void error(string msg)
        {
                throw new Exception("");
        }

        void fun2(){}

        void fun1()
        {
                error("");
                fun2;
        }
}
```

Leads to a warning.

--
August 01, 2018
https://issues.dlang.org/show_bug.cgi?id=13165

Vitali Karabitski <vitali.karabitski@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vitali.karabitski@gmail.com

--- Comment #4 from Vitali Karabitski <vitali.karabitski@gmail.com> ---
Additional issue opened in vibe.d project,
this time the generated warning leads to compilation failure
https://github.com/vibe-d/vibe.d/issues/2193

--
August 01, 2018
https://issues.dlang.org/show_bug.cgi?id=13165

Vitali Karabitski <vitali.karabitski@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |major

--
October 31, 2019
https://issues.dlang.org/show_bug.cgi?id=13165

Tobias Pankrath <tobias@pankrath.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tobias@pankrath.net

--- Comment #5 from Tobias Pankrath <tobias@pankrath.net> ---
Also occurs when using pegged. Fails in std.regex.

--
October 08
https://issues.dlang.org/show_bug.cgi?id=13165

Mathias LANG <pro.mathias.lang@gmail.com> changed:

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

--- Comment #6 from Mathias LANG <pro.mathias.lang@gmail.com> ---
*** Issue 21297 has been marked as a duplicate of this issue. ***

--