Bug 18050 – Destructor called without corresponding postblit

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-12-09T06:11:22Z
Last change time
2017-12-09T09:46:52Z
Assigned to
No Owner
Creator
Mike Franklin

Comments

Comment #0 by slavo5150 — 2017-12-09T06:11:22Z
import std.stdio; struct Foo { this(int) {} ~this() {} } struct Bar { this(this) { writefln("Bar.this(this): %X", &this); } this(Foo, Foo) { writefln("Bar.this(int): %X", &this); } ~this() { writefln("Bar.~this(): %X", &this); } } void fun(Bar n) { writefln("fun: %X", &n); } void main() { fun(Bar(Foo(0), Foo(1))); } Bar.this(int): 7FFD0B307D21 fun: 7FFD0B307CD0 Bar.~this(): 7FFD0B307CD0 Bar.~this(): 7FFD0B307D21 https://run.dlang.io/is/ivulRI See http://forum.dlang.org/post/[email protected]
Comment #1 by slavo5150 — 2017-12-09T09:46:52Z
*** This issue has been marked as a duplicate of issue 17246 ***