================
Comment at: lib/CodeGen/CGExprCXX.cpp:321
@@ -320,3 +320,3 @@
if ((MD->isCopyAssignmentOperator() || MD->isMoveAssignmentOperator()) &&
- MD->isTrivial()) {
+ MD->isTrivial() && !MD->getParent()->mayInsertExtraPadding()) {
llvm::Value *Src = EmitLValue(E->getArg(1)).getAddress();
----------------
rsmith wrote:
> Is `mayInsertExtraPadding` ever `true` for a union? The non-`memcpy` path
> will not do the right thing for a trivial assignment operator in that case.
It is never true:
bool RecordDecl::mayInsertExtraPadding(bool EmitRemark) const {
...
else if (CXXRD->isUnion())
ReasonToReject = 2; // is a union.
http://reviews.llvm.org/D6160
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits