Bug 21985 – "goto" errors with unexistent label report wrong/misleading line

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-05-28T19:07:40Z
Last change time
2021-05-29T23:06:36Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
naydef

Comments

Comment #0 by naydef — 2021-05-28T19:07:40Z
Code: --------------------------- void main(string[] args) { goto findme; } --------------------------- onlineapp.d(1): Error: function `D main` label `findme` is undefined The error message should print the exact line, where the label is used.
Comment #1 by dlang-bot — 2021-05-29T16:01:47Z
@MoonlightSentinel created dlang/dmd pull request #12605 "Fix 21985 - Ensure that LabelDsymbols have an explicit location" fixing this issue: - Fix 21985 - Ensure that LabelDsymbols have an explicit location This allows the error reporting to point to the first usage of an unknown label. https://github.com/dlang/dmd/pull/12605
Comment #2 by dlang-bot — 2021-05-29T23:06:36Z
dlang/dmd pull request #12605 "Fix 21985 - Ensure that LabelDsymbols have an explicit location" was merged into master: - 75407aeef71ff5c0fe0a02a15b2b73585c4faf0e by MoonlightSentinel: Fix 21985 - Ensure that LabelDsymbols have an explicit location This allows the error reporting to point to the first usage of an unknown label. https://github.com/dlang/dmd/pull/12605