From 92b3f47de277c491f7fdd236beaf2ab87988b640 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 14 Aug 2009 00:01:54 +0000 Subject: 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 --- clang/lib/CodeGen/CodeGenModule.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c9e7e93..6a5700e 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -739,7 +739,9 @@ void CodeGenModule::DeferredCopyAssignmentToEmit(GlobalDecl CopyAssignDecl) { CXXRecordDecl *BaseClassDecl = cast(Base->getType()->getAs()->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(FieldClassType->getDecl()); const CXXMethodDecl *MD = 0; - if (FieldClassDecl->hasConstCopyAssignment(getContext(), MD)) + if (!FieldClassDecl->hasTrivialCopyAssignment() && + !FieldClassDecl->hasUserDeclaredCopyAssignment() && + FieldClassDecl->hasConstCopyAssignment(getContext(), MD)) GetAddrOfFunction(GlobalDecl(MD), 0); } } -- cgit v1.1