Bug 4946 – Not good error message with wrongly positioned 'const'

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-09-26T10:38:24Z
Last change time
2017-12-18T22:56:37Z
Keywords
bootcamp, diagnostic
Assigned to
No Owner
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-09-26T10:38:24Z
This seems wrong D2 code: struct Foo { void bar(int x)() if (x > 0) const {} } void main() {} DMD 2.049 prints: test.d(2): semicolon expected following function declaration But a better error message is to tell that the position of 'const' is wrong.
Comment #1 by andrej.mitrovich — 2012-12-27T18:05:06Z
*** Issue 6915 has been marked as a duplicate of this issue. ***
Comment #2 by razvan.nitu1305 — 2017-11-02T16:23:50Z
Comment #3 by github-bugzilla — 2017-11-06T16:15:20Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f9879d74ea09034e68829551c3b3902c28e08bec Fix Issue 4946 - Not good error message with wrongly positioned 'const' https://github.com/dlang/dmd/commit/05fcb67900f5233f77584b6dd21da31d04702e13 Merge pull request #7280 from RazvanN7/Issue_4946 Fix Issue 4946 - Not good error message with wrongly positioned 'const' merged-on-behalf-of: Andrei Alexandrescu <[email protected]>
Comment #4 by github-bugzilla — 2017-12-18T22:56:37Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f9879d74ea09034e68829551c3b3902c28e08bec Fix Issue 4946 - Not good error message with wrongly positioned 'const' https://github.com/dlang/dmd/commit/05fcb67900f5233f77584b6dd21da31d04702e13 Merge pull request #7280 from RazvanN7/Issue_4946