Bug 11066 – Spurious warning 'statement is not reachable' with -profile

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-18T20:19:00Z
Last change time
2014-08-22T08:04:28Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
kekeniro2

Comments

Comment #0 by kekeniro2 — 2013-09-18T20:19:31Z
The code below gives an wrong warning. This is a regression introduced in 2.063. However, without -w option it works, so this may be a minor issue. COMMAND: dmd -profile -w CODE: import std.string; void main() { auto s = toLower(""); } OUTPUT: Warning: statement is not reachable // Note: It doesn't show its location.
Comment #1 by kekeniro2 — 2013-09-18T20:25:12Z
Reduced test case is here: void main() { string s; foreach (dchar c; s) // affected by dchar return; }
Comment #2 by kekeniro2 — 2014-06-16T01:01:06Z
Test case in #0 does not reproduce, but #1 does. Updated the summary.
Comment #3 by k.hara.pg — 2014-07-10T09:03:16Z
Comment #4 by github-bugzilla — 2014-07-12T10:13:11Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/389516c5c7a63f7da021c694e4e71cb03ae8d833 fix Issue 11066 - Spurious warning 'statement is not reachable' with -profile https://github.com/D-Programming-Language/dmd/commit/7200977dc40dd32878136524af2564600ad8593f Merge pull request #3737 from 9rnsr/fix11066 Issue 11066 - Spurious warning 'statement is not reachable' with -profile
Comment #5 by github-bugzilla — 2014-07-16T03:52:22Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d30cd0004d94d23c3880492f85f859b999618082 Merge pull request #3737 from 9rnsr/fix11066 Issue 11066 - Spurious warning 'statement is not reachable' with -profile
Comment #6 by github-bugzilla — 2014-08-22T08:04:28Z