https://issues.dlang.org/show_bug.cgi?id=20809
welkam <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #5 from welkam <[email protected]> --- Even more reduced test case ---------------------------- struct S { int a; ~this() { a = 0; } } void main() { assert(foo() == 2); // foo() is 0 } int foo() { //bug is here return S(2).a; // destructor of the struct is called in this scope and sets a to 0 } --
