diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-14 00:01:54 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-14 00:01:54 +0000 |
commit | 183d7181fd59842ac969cbc6fe0376f85dc63ae4 (patch) | |
tree | d43f3d5fa1b2d8f0a3878c9bd8c08ae123257e73 /lib/CodeGen/CodeGenModule.cpp | |
parent | 788467852cfbd940c796537849db5beef20253e8 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78965 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index c9e7e934fd..6a5700ef19 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -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); } } |