[Issue 9985] Postblit isn't called on local struct return

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 25 01:04:51 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9985



--- Comment #6 from Kenji Hara <k.hara.pg at gmail.com> 2013-04-25 01:04:51 PDT ---
(In reply to comment #0)
> Maybe this is a bug in RVO?

This is a compiler bug at the intersection of the deduction for `auto ref` and
NRVO.

If change the code
    auto ref makeS()
to:
    auto makeS()
The code would print the result as follows.

    made S at 12FDA0, s.b == 12FDA4
    got back S at 12FDA0, s.b == 12FDA4    <-- NRVO applied!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list