D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6637 - Postblits of static array elements are not called on function argument
Summary: Postblits of static array elements are not called on function argument
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: patch, wrong-code
Depends on:
Blocks:
 
Reported: 2011-09-09 09:13 UTC by Kenji Hara
Modified: 2012-05-07 21:13 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 Kenji Hara 2011-09-09 09:13:45 UTC
struct S
{
    static int spblit;

    this(this){ ++spblit; }
}

void test()
{
    void func(S[3] sa){}

    S[3] sa;
    func(sa);   // sa should be copied
    assert(S.spblit == 3);
}
Comment 2 SomeDude 2012-04-27 14:45:30 UTC
Like issue 6636, this fails on 2.059 unless compiled with -release option.
Comment 3 github-bugzilla 2012-05-07 19:43:30 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/2f09427e321e1587fdebc983f25f8b4c78cd5f0d
Issue 6637 - Postblits of static array elements are not called on function argument

call element postblits of static array on function argument