digitalmars.D.bugs - [Issue 15731] New: Analysis error on explicit case fall-through
- via Digitalmars-d-bugs (49/52) Feb 27 2016 https://issues.dlang.org/show_bug.cgi?id=15731
https://issues.dlang.org/show_bug.cgi?id=15731 Issue ID: 15731 Summary: Analysis error on explicit case fall-through Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: jbc.engelen gmail.com The following code compiles fine without explicit fall-through, but with -version=bad it errors. int hexStringConstant(dchar* p) { while (1) { dchar c = *p++; switch (c) { case ' ': case '\t': case '\v': case '\f': continue; case '\r': if (*p == '\n') continue; version(bad) /// <-- Look here goto case; case '\n': continue; case 0: case 0x1A: return 111; case '"': return 222; default: break; } } }dmd -c bug.d[ no problem ]dmd -c bug.d -wbug.d(18): Warning: switch case fallthrough - use 'goto case;' if intendeddmd -c bug.d -version=badbug.d(1): Error: function bug.hexStringConstant no return exp; or assert(0); at end of function --
Feb 27 2016