dpp icon indicating copy to clipboard operation
dpp copied to clipboard

Dpp should generate the correct type,mangling size and alignment for aggregate ref member

Open Laeeth opened this issue 5 years ago • 4 comments

your code might work but dpp offset probably doesn't https://github.com/rust-lang/rust-bindgen/issues/1443

Laeeth avatar Jan 09 '19 01:01 Laeeth

Looks fine to me:

struct Bar {
        Foo* foo;
}
struct Foo {
    int a;
    int b;
    int c;
}

static assert(Foo.sizeof == 12); 
static assert(Foo.alignof == 4);
static assert(Bar.sizeof == 8);
static assert(Bar.alignof == 8);

The numbers in the static asserts were taken from C++.

Struct members don't have mangling, D doesn't have reference types, and I don't see any alignment problems here either.

I don't understand what you mean by "dpp offset".

atilaneves avatar Jan 09 '19 12:01 atilaneves

That's because you are ignoring my PR :(. Struct DppOffset

Laeeth avatar Jan 10 '19 04:01 Laeeth

That's because you are ignoring my PR

Not at all, I'm working through the previous one, figuring out how best to support the usecase, making it happen then moving on to the other two.

atilaneves avatar Jan 10 '19 11:01 atilaneves

Okay, tku :)

Laeeth avatar Jan 10 '19 23:01 Laeeth