Thread overview
[Issue 20772] va_arg doesn't work for structs with copy constructors
Apr 26, 2020
Iain Buclaw
Apr 26, 2020
Dlang Bot
Apr 27, 2020
Dlang Bot
April 26, 2020
https://issues.dlang.org/show_bug.cgi?id=20772

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
I don't think this is a druntime bug.  The compiler sets __argTypes differently for structs with cpctors vs. structs without:

```
static if (is(T U == __argTypes))
    pragma(msg, T, " = ", U);
```

Prints:
CopyConstructor = ()
NoCopyConstructor = (int)

--
April 26, 2020
https://issues.dlang.org/show_bug.cgi?id=20772

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

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

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ibuclaw created dlang/dmd pull request #11065 "fix Issue 20771, 20772, disallow passing non-trivially copyable types as variadic arguments" fixing this issue:

- fix Issue 20772 - va_arg doesn't work for structs with copy constructors

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

--
April 27, 2020
https://issues.dlang.org/show_bug.cgi?id=20772

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 #11065 "fix Issue 20771, 20772, 20775 disallow passing non-trivially copyable types as variadic arguments" was merged into master:

- e8d157d3f9c9531c0812b6325ba2244abe6bc946 by Iain Buclaw:
  fix Issue 20772 - va_arg doesn't work for structs with copy constructors

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

--