1388 – multiple static constructors allowed in module

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1388 - multiple static constructors allowed in module
Summary: multiple static constructors allowed in module
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Linux
: P2 normal
Assignee: Walter Bright
URL:
Keywords: accepts-invalid, spec
Depends on:
Blocks:
Reported: 2007年07月31日 00:51 UTC by Tomas Lindquist Olsen
Modified: 2014年02月16日 15:26 UTC (History)
0 users

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 Tomas Lindquist Olsen 2007年07月31日 00:51:33 UTC
module bad;
static this() {}
static this() {}
^^
The dmd frontend accepts this but generates two function declarations with the same mangled name. Causes code generation error in gdc 0.23.
I could not find anywhere in the spec where it's specified whether multiple module constructors are allowed, so I have marked this bug 'spec' as well.
Comment 1 Tomas Lindquist Olsen 2007年07月31日 01:03:58 UTC
Same thing for destructors.
Comment 2 Walter Bright 2007年09月28日 22:09:55 UTC
Fixed dmd 1.021 and 2.004


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