Bug 13201 – Wrong "Warning: statement is not reachable" error with -w

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-24T17:04:00Z
Last change time
2014-08-22T08:05:11Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
dragoscarp

Comments

Comment #0 by dragoscarp — 2014-07-24T17:04:20Z
Following code compiled with "-w" produces error (sic!) "Warning: statement is not reachable" on the line of the second "break" statement. Without "-w", it compiles with no message and the executable runs and exits imediately as expected. ------------------------------ void foo() { } void main() { while (true) { do { foo; break; } while (true); break; } }
Comment #1 by dragoscarp — 2014-07-30T10:40:28Z
Upgraded it to regression because following code successfully compiles with dmd-2.065 (-w flag) and with dmd-2.066.0-b6 (-w flag) produces "Warning: statement is not reachable" on "synchronized" line. ============================== class Foo { } class Bar { Foo foo() { synchronized { assert(0); } } }
Comment #2 by k.hara.pg — 2014-07-30T14:15:40Z
The case in comment#0 would be a dup of 8052, and it is not a regression issue. The case in comment#1 is actually a regression from 2.066 beta. Introduced in: https://github.com/D-Programming-Language/dmd/pull/3592 https://github.com/D-Programming-Language/dmd/pull/3835
Comment #3 by github-bugzilla — 2014-07-30T15:39:44Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/88fb243d1bebc65f7dc12b2d2306842ce637aa32 fix Issue 13201 - Wrong "Warning: statement is not reachable" error with -w https://github.com/D-Programming-Language/dmd/commit/3d33947a84b7cceaa259564cf3bc081bf4d5b550 Merge pull request #3835 from 9rnsr/fix13201 [REG2.066a] Issue 13201 - Wrong "Warning: statement is not reachable" error with -w
Comment #4 by github-bugzilla — 2014-07-31T02:35:24Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/64da724597d934730b5ab56127d6df641d5a9516 Merge pull request #3835 from 9rnsr/fix13201 [REG2.066a] Issue 13201 - Wrong "Warning: statement is not reachable" error with -w
Comment #5 by github-bugzilla — 2014-08-22T08:05:11Z