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


bearophile_h...@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|wrong-code                  |diagnostic
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |
            Summary|Ignored break inside static |switch case fallthrough
                   |foreach                     |error despite a break
                   |                            |inside static foreach


--- Comment #4 from bearophile_h...@eml.cc 2012-04-06 10:18:05 PDT ---
Reopened, because you have missed the error message in my bug report.

Using a labeled break:


import core.stdc.stdio: printf;
template TypeTuple(TList...) {
    alias TList TypeTuple;
}
void main() {
    char c = 'b';
    MySwitch: switch (c) {
        case 'a': printf("1 a\n"); break;
        foreach (o; TypeTuple!('b', 'c')) {
            case o: printf("2 %c\n", c); break MySwitch;
        }
        default: printf("default");
    }
}


DMD 2.059 beta gives (compiling with -w):

test.d(12): Error: switch case fallthrough - use 'goto default;' if intended

I have also changed the issue title to better reflect the problem, now the
Keywords is 'diagnostic' because it's giving a warning where there is nothing
to warn against.

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

Reply via email to