D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7754 - static this() in template is stripped during header gen
Summary: static this() in template is stripped during header gen
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull
: 7611 (view as issue list)
Depends on:
Blocks:
 
Reported: 2012-03-23 09:29 UTC by Martin Nowak
Modified: 2012-03-27 00:06 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2012-03-23 09:29:21 UTC
cat > bug.d << CODE
struct Foo(T)
{
    shared static this()
    {
    }

    static this()
    {
    }
}
CODE

dmd -c -o- -H bug.d
cat bug.di

// D import file generated from 'bug.d'
template Foo(T)
{
struct Foo
{
    shared static this();
    static this();
}
}

--------

Thus the static constructors are not run.
Comment 2 Kenji Hara 2012-03-23 23:52:46 UTC
*** Issue 7611 has been marked as a duplicate of this issue. ***
Comment 3 github-bugzilla 2012-03-26 22:43:32 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/311d1701d6dc7c454f03fca4d84f62e157e14e5a
Merge pull request #829 from 9rnsr/fix7754

Issue 7754 - static this() in template is stripped during header gen