October 13, 2017 [Issue 17897] New:=?UTF-8?Q?=20=D0=97ostbit=20is=20not=20called=20for=20temporary=20structures=20in=20the=20function=20parameters?= | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17897 Issue ID: 17897 Summary: Зostbit is not called for temporary structures in the function parameters Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: japplegame@gmail.com Test case: 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() { Foo foo; fun(Bar(foo, Foo(0))); } Result: Bar.this(int): XXXXXXXXXXXX fun: XXXXXXXXXXXX Bar.~this(): XXXXXXXXXXXX Bar.~this(): XXXXXXXXXXXX Expected: Bar.this(int): XXXXXXXXXXXX Bar.this(this): XXXXXXXXXXXX fun: XXXXXXXXXXXX Bar.~this(): XXXXXXXXXXXX Bar.~this(): XXXXXXXXXXXX Discussion: https://forum.dlang.org/post/tvzwzrpwadobzsxcalxy@forum.dlang.org -- |
Copyright © 1999-2021 by the D Language Foundation