The following code currently does not compile: import core.lifetime; extern(C++) struct S { @disable this(); this(int) { } this(ref const(S) other) { } } void main() { S s1 = S(1); S s2 = void; copyEmplace(s1, s2); } DMD prints the following error messages: /usr/include/dlang/dmd/core/internal/lifetime.d(18): Error: static assert: "Cannot emplace a S because S.this() is annotated with @disable." /usr/include/dlang/dmd/core/lifetime.d(17): instantiated from here: `emplaceRef!(S, S)` /usr/include/dlang/dmd/core/lifetime.d(1251): instantiated from here: `emplace!(S)` testcopyctor.d(16): instantiated from here: `copyEmplace!(S, S)` The default constructor should not be necessary to use the copy constructor.
@RazvanN7 created dlang/druntime pull request #3799 "Fix Issue 22766 - copyEmplace does not work with copy constructor and @disable this()" fixing this issue: - Fix Issue 22766 - copyEmplace does not work with copy constructor and @disable this() https://github.com/dlang/druntime/pull/3799
dlang/druntime pull request #3799 "Fix Issue 22766 - copyEmplace does not work with copy constructor and @disable this()" was merged into master: - e815ab7abd4fa04bcb698cbf635a1caa25aa3061 by RazvanN7: Fix Issue 22766 - copyEmplace does not work with copy constructor and @disable this() https://github.com/dlang/druntime/pull/3799