When allocating a C++ class instance with the constructor defined in C++, the wrong object address is used: // testcpp.cpp class Cpp { public: Cpp(); virtual void foo() {} int x; }; Cpp::Cpp() { x = 42; } // testd.d extern(C++) { class Cpp { public: this(); void foo(); int x; } } void main() { Cpp c = new Cpp; assert(c.x == 42); } The assertion fails for OSX and FreeBSD, but not on Windows and Linux. This happens because the constructor does not return 'this' on the former platforms.
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17864 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB