Bug 15706 – std.conv.to!int - wrong line number in exception

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2016-02-19T19:26:59Z
Last change time
2023-02-13T15:00:36Z
Assigned to
No Owner
Creator
Ivan Kazmenko
See also
https://issues.dlang.org/show_bug.cgi?id=15948

Comments

Comment #0 by gassa — 2016-02-19T19:26:59Z
Example program (test.d): ----- import std.conv; void main () { auto d = to !(int) ("@"); } ----- Compiling with dmd 2.070.0 on Windows 32-bit with "dmd -g test.d", I get: ----- std.conv.ConvException@std\conv.d(2002): Unexpected '@' when converting from type string to type int ---------------- ... 0x00408A80 in main at C:\programs\stuff\dlang\phobos-4008\test.d(7) ... ----- The actual line number is 3, not 7. If I compile as "dmd -O -g test.d", the reported line number is 8: wrong again, but different.
Comment #1 by gassa — 2016-02-19T19:28:28Z
The line number is right when compiling to 64 bits ("-m64").
Comment #2 by razvan.nitu1305 — 2023-02-13T15:00:36Z
I cannot reproduce this.