[Issue 19841] Wrong ABI for C++ functions taking a struct by value

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 7 04:55:15 UTC 2020


--- Comment #6 from Walter Bright <bugzilla at digitalmars.com> ---
D's definition of POD is:

1. it is not nested
2. it has no postblits, destructors, or assignment operators
3. it has no ref fields or fields that are themselves non-POD


C++'s definition is quite a bit more complicated, and changes from one version
of the Standard to another:


For reference, "the equivalent C++ code" is:

struct Foo {
    char _[32];

struct Bar {
    Bar(Foo foo);

void oops() {
    auto foo = Foo();
    auto bar = Bar(foo);


More information about the Digitalmars-d-bugs mailing list