On 18/05/18 22:57, kinke wrote:
I checked, and the reason is that D and C++ use a different ABI wrt. by-value passing of non-POD arguments. C++ indeed passes a reference to a caller-allocated rvalue, not just on Win64; that makes it trivial, as there are no moves across call boundaries. But your proposal may imply changing the D ABI accordingly.

That seems to be the case.

Assuming https://dlang.org/spec/abi.html is the ABI you refer to, there is very little in way of argument calling there:

https://dlang.org/spec/abi.html#function_calling_conventions

"
The extern (C) and extern (D) calling convention matches the C calling convention used by the supported C compiler on the host system. Except that the extern (D) calling convention for Windows x86 is described here.
"

So the current state is, in essence, that in C everything is PoD, and that's why that's also the case in D. Yes, something will need to change there.

Shachar

Reply via email to