D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21985 - "goto" errors with unexistent label report wrong/misleading line
Summary: "goto" errors with unexistent label report wrong/misleading line
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords: diagnostic, pull
Depends on:
Blocks:
 
Reported: 2021-05-28 19:07 UTC by naydef
Modified: 2021-05-29 23:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description naydef 2021-05-28 19:07:40 UTC
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 Dlang Bot 2021-05-29 16:01:47 UTC
@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 Dlang Bot 2021-05-29 23:06:36 UTC
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