This is currently part of the dmd test suite [1]:

extern (C++) interface E
{
    int bar(int i, int j, int k);
}

extern (C++) int callE(E);

static assert (callE.mangleof == "_Z5callEP1E");

The last line checks that callE() will pass its argument by pointer.

This is fine in the case where E is a D interface because of reference semantics: it should be passed by pointer.

But, in the case where an extern(C++) function calls an extern(C++) type should it be value semantic - as it is in C++ - or reference semantic - as it is in D?

Thoughts?

--
1. https://github.com/dlang/dmd/blob/master/test/compilable/cppmangle.d#L102

Reply via email to