https://issues.dlang.org/show_bug.cgi?id=16652
Martin Nowak <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|returned rvalue gets |[Reg 2.071] returned rvalue |destroyed before |destroyed too early |expressions ends | Severity|major |regression --- Comment #1 from Martin Nowak <[email protected]> --- Turns out this is actually a regression introduced by https://github.com/dlang/dmd/pull/5292. Also here is the test case with an assertion instead of writeln. cat > bug.d << CODE struct Vector { this(ubyte a) { buf[] = a; } ubyte[] opSlice() { return buf[]; } ~this() { buf[] = 0; } ubyte[4] buf; } void bar(ubyte[] v) { assert(v[0] == 1); } void main() { bar(Vector(1)[]); } CODE dmd -inline -run bug --
