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

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5111 - Static function-level variables are not in the language spec.
Summary: Static function-level variables are not in the language spec.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: Other Other
: P2 normal
Assignee: No Owner
URL:
Keywords: spec, wrong-code
Depends on:
Blocks:
Reported: 2010年10月24日 03:46 UTC by Peter Alexander
Modified: 2015年06月09日 05:14 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Peter Alexander 2010年10月24日 03:46:32 UTC
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 Walter Bright 2012年01月20日 00:20:16 UTC
Fixed in function.html


AltStyle によって変換されたページ (->オリジナル) /