зеркало из https://github.com/microsoft/clang-1.git
Use the new function in EmitClassAggrMemberwiseCopy, fixing the same assert as seen in PR6628 but for arrays this time.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99867 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
21c9ad9d29
Коммит
8887bdcd40
|
@ -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.
|
||||
|
|
|
@ -128,6 +128,7 @@ struct A {
|
|||
struct B : A {
|
||||
A a1;
|
||||
A a2;
|
||||
A a[10];
|
||||
};
|
||||
|
||||
// Force the copy constructor to be synthesized.
|
||||
|
|
Загрузка…
Ссылка в новой задаче