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.