https://issues.dlang.org/show_bug.cgi?id=15629
Kenji Hara <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[REG] wrong code with "-O |[REG2.066.0] wrong code |-inline" but correct with |with "-O -inline" but |"-O" |correct with "-O" --- Comment #4 from Kenji Hara <[email protected]> --- (In reply to Kenji Hara from comment #3) > Dustmited case code: Sorry, the reduced code cannot reproduce exactly same regression with the original. I'll open one more issue for that. Correct minimized code is: void main() { int[] a = [3]; int value = abs(a[0]); assert(a[0] == 3); writeln(value, " ", a); } Num abs(Num)(Num x) { return x >= 0 ? x : -x; } struct File { struct LockingTextWriter { this(File) {} ~this() @trusted {} } auto lockingTextWriter() { return LockingTextWriter(); } } File stdout; void writeln(T...)(T args) { stdout.lockingTextWriter(); } Introduced in: https://github.com/D-Programming-Language/dmd/pull/3620 and its fixup PR: https://github.com/D-Programming-Language/dmd/pull/3656 So this is a regression from 2.066.0. --
