[Issue 6552] New: Wrong fallthrough warning for CaseRange

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Aug 24 19:30:49 PDT 2011


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

           Summary: Wrong fallthrough warning for CaseRange
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at gmx.ch 2011-08-24 19:30:48 PDT ---
void main() {
    int c;
    switch (c) {
        case 1,2:
        case 3,4: break;
        default: break;
    }
}

Compile with warnings on, DMD v2.054:
tt.d(12): Error: switch case fallthrough - use 'goto case;' if intended

This warning is wrong.

For comparison, the equivalent code without CaseRanges passes even with
warnings on:

void main() {
    int c;
    switch (c) {
        case 1:
        case 2: break;
        default: break;
    }
}

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


More information about the Digitalmars-d-bugs mailing list