July 11, 2020 [Issue 21036] New: wrong code for non-pod types when compiled function with variadic static array | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=21036 Issue ID: 21036 Summary: wrong code for non-pod types when compiled function with variadic static array Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: blocker Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: ilyayaroshenko@gmail.com import std.stdio; struct S { void* ptr; this(this){pragma(inline, false); writeln("cp");} ~this(){pragma(inline, false); writeln("des");} } auto bar(S[2] a...) { return a; } void main() { bar(S.init, S.init); } $ dmd -run test.d cp cp des des des des des des Expected 4 des, instead of 6. -- |
Copyright © 1999-2021 by the D Language Foundation