www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13165] New: Not located "Warning: statement is not reachable"


          Issue ID: 13165
           Summary: Not located "Warning: statement is not reachable" with
                    -profile, If return statement exists in void main()
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: sinkuu aol.jp

void main()
    // Warning: statement is not reachable
    // (No location reported, but removing `return;` prevents this warning.)

Same warning with always true condition:

void main() { if (true) return; }

No warnings:

void main(string[] args) { if (args) return; }
int main() { return 0; }
void myFunc() { return; } // happens only in void main()

Jul 19 2014