Thread overview
[Issue 24577] Struct with constructor returned from C++ wrong
Jun 01, 2024
Tim
Jun 01, 2024
kinke
Jun 08, 2024
Dlang Bot
Jun 08, 2024
Dlang Bot
June 01, 2024
https://issues.dlang.org/show_bug.cgi?id=24577

Tim <tim.dlang@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |C++

--
June 01, 2024
https://issues.dlang.org/show_bug.cgi?id=24577

kinke <kinke@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke@gmx.net

--- Comment #1 from kinke <kinke@gmx.net> ---
I'm pretty sure there's an existing issue about this. IIRC, it's backend specific, LDC working fine. It boils down to MSVC++ having separate POD semantics - any struct with an explicit constructor makes it a non-POD. Such types are returned via sret (caller passing a pointer to the pre-allocated result).

--
June 08, 2024
https://issues.dlang.org/show_bug.cgi?id=24577

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@tim-dlang created dlang/dmd pull request #16570 "Fix bugzilla 24577 - Struct with constructor returned from C++ wrong" fixing this issue:

- Fix bugzilla 24577 - Struct with constructor returned from C++ wrong

  The test case is copied from LDC, where it already worked. It also has
  an additional test for a member struct with constructor.

https://github.com/dlang/dmd/pull/16570

--
June 08, 2024
https://issues.dlang.org/show_bug.cgi?id=24577

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #16570 "Fix bugzilla 24577 - Struct with constructor returned from C++ wrong" was merged into master:

- d8a684c435aca1f85fcb6a250beed5628284f777 by Tim Schendekehl:
  Fix bugzilla 24577 - Struct with constructor returned from C++ wrong

  The test case is copied from LDC, where it already worked. It also has
  an additional test for a member struct with constructor.

https://github.com/dlang/dmd/pull/16570

--