Bug 19870 – Generated Copy Constructor disables default construction
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-05-14T12:56:52Z
Last change time
2019-05-14T16:03:08Z
Assigned to
No Owner
Creator
RazvanN
Comments
Comment #0 by razvan.nitu1305 — 2019-05-14T12:56:52Z
struct T
{
int i;
this(ref return scope inout typeof(this) src)
inout @safe pure nothrow @nogc
{
i = src.i;
}
}
struct S
{
T t;
}
auto bar(T a)
{
S b = S(a); // Error
}
Expected behavior: code compiles succesfulyy