Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions compiler/src/dmd/dstruct.d
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,15 @@ extern (C++) class StructDeclaration : AggregateDeclaration
if (ispod != ThreeState.none)
return (ispod == ThreeState.yes);

ispod = ThreeState.yes;

import dmd.clone;

bool hasCpCtorLocal;
needCopyCtor(this, hasCpCtorLocal);

if (enclosing || search(this, loc, Id.postblit) || search(this, loc, Id.dtor) || hasCpCtorLocal)
if (enclosing || // is nested
search(this, loc, Id.postblit) || // has postblit
search(this, loc, Id.dtor) || // has destructor
hasCpCtorLocal) // has copy constructor
{
ispod = ThreeState.no;
return false;
Expand All @@ -453,20 +455,18 @@ extern (C++) class StructDeclaration : AggregateDeclaration
return false;
}

Type tv = v.type.baseElemOf();
if (tv.ty == Tstruct)
if (auto ts = v.type.baseElemOf().isTypeStruct())
{
auto ts = cast(TypeStruct)tv;
StructDeclaration sd = ts.sym;
if (!sd.isPOD())
if (!ts.sym.isPOD())
{
ispod = ThreeState.no;
return false;
}
}
}

return (ispod == ThreeState.yes);
ispod = ThreeState.yes;
return true;
}

/***************************************
Expand Down