[Issue 11740] [64-bit] Struct with constructor incorrectly passed on stack

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 15 14:14:17 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11740



--- Comment #2 from Iain Buclaw <ibuclaw at ubuntu.com> 2013-12-15 14:14:12 PST ---
(In reply to comment #1)
> This is working correctly as designed. Structs with constructors are considered
> non-POD, so they cannot be bit-copied in and out of registers.


Maybe we should start considering whether structs are trivially copyable like
C++ does.

eg:
StructDeclaration::isTriviallyCopyable()
if has no copy constructor
&& if has no postblit
&& if has a trivial destructor
&& if not nested inside another struct/class.

Which slightly differs from isPOD.

To compare behaviours, GDC should return from S ctor in memory, then pass via
registers to C.func.  Call it a bug in GDC, but we only listen to isPOD for
returning structs, not passing them. ;)

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list