Bug 399 – -w misses unreacheable "case" statement

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-10-04T13:28:00Z
Last change time
2014-02-15T13:19:23Z
Keywords
diagnostic
Assigned to
bugzilla
Creator
thomas-dloop

Comments

Comment #0 by thomas-dloop — 2006-10-04T13:28:31Z
# import std.stdio; # # int main(char[][] args){ # switch(args.length){ # case 2: # writefln("case 2"); # goto case 1000; # default: # writefln("default"); # break; # case 1000: # writefln("case 1000 (reachable)"); # break; # case 3: // line 14 # writefln("case 3 (statement is not reachable)"); # break; # } # # return 0; # } "dmd -w test.d" fails to report lines 14 to 16 as unreachable.
Comment #1 by bugzilla — 2006-10-04T14:04:28Z
Compiling and running the sample: dmd test test a b gives the output: case 3 (statement is not reachable)
Comment #2 by thomas-dloop — 2006-10-04T14:07:48Z
Sorry for confusing non-D and D grammar.