Bug 5111 – Static function-level variables are not in the language spec.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
Other
OS
Other
Creation time
2010-10-24T03:46:00Z
Last change time
2015-06-09T05:14:50Z
Keywords
spec, wrong-code
Assigned to
nobody
Creator
peter.alexander.au

Comments

Comment #0 by peter.alexander.au — 2010-10-24T03:46:32Z
The language specification makes no reference to function-level static variables (other than in the grammar production rules). Static member variables and functions are mentioned in the "Attributes" page. That page should (at a minimum) specify that: - Local variables with the static storage class have a lifetime that extends beyond the function call. - It should mention when and how they are initialised (before main, or at first use?). - It should clarify whether statics with the same name, but different block scopes are allowed. i.e. void main() { { static int x; } { static int x; } // allowed? }
Comment #1 by bugzilla — 2012-01-20T00:20:16Z
Fixed in function.html