Bug 4663 – Wrong 'static' position error message

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-08-17T07:10:48Z
Last change time
2023-06-14T05:42:39Z
Keywords
bootcamp, diagnostic, pull
Assigned to
No Owner
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-08-17T07:10:48Z
Compiling this program with dmd 2.048: void main() { void foo() static {} } I receive the errors: test.d(2): semicolon expected following function declaration test.d(2): basic type expected, not { test.d(2): no identifier for declarator int test.d(2): semicolon expected, not '{' Maybe storage classes can't be written on the right side, but I'd like a better error message here.
Comment #1 by andrej.mitrovich — 2012-12-27T18:08:41Z
Similar to Issue 4946 but maybe not a duplicate since that one involves template constraints.
Comment #2 by dlang-bot — 2023-06-13T17:14:04Z
@ntrel created dlang/dmd pull request #15321 "Fix Issue 4663 - Wrong 'static' position error message" fixing this issue: - Fix Issue 4663 - Wrong 'static' position error message Also detects `extern`, `deprecated`, `ref`, `override` and friends. https://github.com/dlang/dmd/pull/15321
Comment #3 by dlang-bot — 2023-06-14T05:42:39Z
dlang/dmd pull request #15321 "Fix Issue 4663 - Wrong 'static' position error message" was merged into master: - 1265a403b505b9f0ad51e155a6de544030c26d4a by Nick Treleaven: Fix Issue 4663 - Wrong 'static' position error message Also detects `extern`, `deprecated`, `ref`, `override` and friends. https://github.com/dlang/dmd/pull/15321