[Issue 18928] extern(C++) bad codegen, wrong calling convention

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 1 22:42:41 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18928

--- Comment #7 from kinke at gmx.net ---
Well it doesn't make too much sense, and even less so to do it for methods
only; I rather think this is some legacy COM compatibility stuff. I did a few
tests, and it really seems to be specific to methods (instance member
functions), which return every struct via sret/RVO, not just non-PODs as
regular functions, incl. class member functions.

So this is essentially a duplicate of
https://issues.dlang.org/show_bug.cgi?id=16987; I thought it was COM-specific
back then.

I tried fixing it for LDC, but that's sadly not trivial, as the ABI stuff
doesn't operate on FuncDeclaration but on TypeFunction, which contains the
calling convention but not whether it's a method.

--


More information about the Digitalmars-d-bugs mailing list