www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8052] New: Spurious warning when exiting out of a labeled Do-While

http://d.puremagic.com/issues/show_bug.cgi?id=8052

           Summary: Spurious warning when exiting out of a labeled
                    Do-While
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: kekeniro2 yahoo.co.jp



Building the following code, I get an incorrect warning.

int test()
{
    loop:
    do {
        break loop;
    } while(false);
    return 0; // isn't unreachable.
}
-----------------------------------
Warning: statement is not reachable

D1 does not warn.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 06 2012