D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8045 - Postblit should be called on function call initilalizer that returns ref
Summary: Postblit should be called on function call initilalizer that returns ref
Status: RESOLVED DUPLICATE of issue 5737
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-04 22:17 UTC by Kenji Hara
Modified: 2012-05-04 23:30 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2012-05-04 22:17:26 UTC
void main()
{
    struct S
    {
        int a;
        this(this)
        {
            ++a;
        }
    }

    ref S f(ref S s)
    {
        return s;
    }

    S s1 = S(10);
    S s2 = f(s1);   // postblit should be called, but doesn't
    assert(s2.a == 11);
}
Comment 2 Kenji Hara 2012-05-04 23:30:37 UTC
(In reply to comment #1)
> Isn't this a duplicate of issue 5737 and issue 6199 ?
> 
> There are currently 12 open bugs concerning postblit. I suspect some are
> duplicates, but I'm not sure which.
> 
> http://d.puremagic.com/issues/buglist.cgi?query_format=advanced&chfield=resolution&short_desc=Postblit&chfieldvalue=FIXED&bug_severity=regression&bug_severity=blocker&bug_severity=critical&bug_severity=major&bug_severity=normal&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&version=D2&short_desc_type=allwordssubstr&component=DMD&component=druntime&component=Phobos&resolution=---&product=D

Thanks. You are right. I'll mark this as a dup of issue 5737.

*** This issue has been marked as a duplicate of issue 5737 ***