Bug 15666 – Grammar does not allow member function attributes on static constructors

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-02-10T00:32:00Z
Last change time
2016-03-19T20:22:25Z
Keywords
spec
Assigned to
nobody
Creator
briancschott
Blocks
10233

Comments

Comment #0 by briancschott — 2016-02-10T00:32:18Z
StaticConstructor: static this ( ) ; static this ( ) FunctionBody StaticDestructor: static ~ this ( ) MemberFunctionAttributesopt ; static ~ this ( ) MemberFunctionAttributesopt FunctionBody SharedStaticConstructor: shared static this ( ) ; shared static this ( ) FunctionBody SharedStaticDestructor: shared static ~ this ( ) MemberFunctionAttributesopt ; shared static ~ this ( ) MemberFunctionAttributesopt FunctionBody According to the grammar static and shared static destructors can have attributes, but constructors cannot. The compiler, as well as the contributors to std.socket, seem to be unaware of this fact: https://github.com/D-Programming-Language/phobos/blob/5978ca7831443cec69430da6b3ccd315aae1878c/std/socket.d#L303
Comment #1 by github-bugzilla — 2016-02-10T18:35:50Z
Comment #2 by github-bugzilla — 2016-03-19T20:22:25Z