Fixed a bug in ir-gen for copy assignment synthesis.

Fixed a bug when evaluating those copy-assignments
which need by lazily syntheized. A test case
for these.

llvm-svn: 78965
This commit is contained in:
Fariborz Jahanian
2009-08-14 00:01:54 +00:00
parent 262332f24b
commit 92b3f47de2
3 changed files with 110 additions and 3 deletions

View File

@@ -739,7 +739,9 @@ void CodeGenModule::DeferredCopyAssignmentToEmit(GlobalDecl CopyAssignDecl) {
CXXRecordDecl *BaseClassDecl
= cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl());
const CXXMethodDecl *MD = 0;
if (BaseClassDecl->hasConstCopyAssignment(getContext(), MD))
if (!BaseClassDecl->hasTrivialCopyAssignment() &&
!BaseClassDecl->hasUserDeclaredCopyAssignment() &&
BaseClassDecl->hasConstCopyAssignment(getContext(), MD))
GetAddrOfFunction(GlobalDecl(MD), 0);
}
@@ -755,7 +757,9 @@ void CodeGenModule::DeferredCopyAssignmentToEmit(GlobalDecl CopyAssignDecl) {
CXXRecordDecl *FieldClassDecl
= cast<CXXRecordDecl>(FieldClassType->getDecl());
const CXXMethodDecl *MD = 0;
if (FieldClassDecl->hasConstCopyAssignment(getContext(), MD))
if (!FieldClassDecl->hasTrivialCopyAssignment() &&
!FieldClassDecl->hasUserDeclaredCopyAssignment() &&
FieldClassDecl->hasConstCopyAssignment(getContext(), MD))
GetAddrOfFunction(GlobalDecl(MD), 0);
}
}