]> granicus.if.org Git - clang/commitdiff
Use the new function in EmitClassAggrMemberwiseCopy, fixing the same assert as seen...
authorAnders Carlsson <andersca@mac.com>
Tue, 30 Mar 2010 03:30:08 +0000 (03:30 +0000)
committerAnders Carlsson <andersca@mac.com>
Tue, 30 Mar 2010 03:30:08 +0000 (03:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99867 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGClass.cpp
test/CodeGenCXX/copy-constructor-synthesis.cpp

index 93f5a7bc438dfabd4d2a0a5b0312da6cc087b557..6702051bc348ef89415fe5f9dac1ac35584202fc 100644 (file)
@@ -401,22 +401,9 @@ void CodeGenFunction::EmitClassAggrMemberwiseCopy(llvm::Value *Dest,
   if (BitwiseCopy)
     EmitAggregateCopy(Dest, Src, Ty);
   else if (CXXConstructorDecl *BaseCopyCtor =
-           BaseClassDecl->getCopyConstructor(getContext(), 0)) {
-    llvm::Value *Callee = CGM.GetAddrOfCXXConstructor(BaseCopyCtor,
-                                                      Ctor_Complete);
-    CallArgList CallArgs;
-    // Push the this (Dest) ptr.
-    CallArgs.push_back(std::make_pair(RValue::get(Dest),
-                                      BaseCopyCtor->getThisType(getContext())));
+           BaseClassDecl->getCopyConstructor(getContext(), 0))
+    EmitCopyCtorCall(*this, BaseCopyCtor, Ctor_Complete, Dest, 0, Src);
 
-    // Push the Src ptr.
-    CallArgs.push_back(std::make_pair(RValue::get(Src),
-                                     BaseCopyCtor->getParamDecl(0)->getType()));
-    const FunctionProtoType *FPT
-      = BaseCopyCtor->getType()->getAs<FunctionProtoType>();
-    EmitCall(CGM.getTypes().getFunctionInfo(CallArgs, FPT),
-             Callee, ReturnValueSlot(), CallArgs, BaseCopyCtor);
-  }
   EmitBlock(ContinueBlock);
 
   // Emit the increment of the loop counter.
index 3af40cb4ec1f52ddbf98c5c3e1402bb8b8efcfe5..9cafd0accdb677767fe844ad221f7c3a731dad0a 100644 (file)
@@ -128,6 +128,7 @@ struct A {
 struct B : A {
   A a1;
   A a2;
+  A a[10];
 };
 
 // Force the copy constructor to be synthesized.