From eb4089ad01a2570dfcdd02efb9071adf1f1b49e9 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 22 Sep 2011 20:32:43 +0000 Subject: Only trigger the initialize-an-array-via-elementwise-copy/move code generation when we're dealing with an implicitly-defined copy or move constructor. And, actually set the implicitly-defined bit for implicitly-defined constructors and destructors. Should fix self-host. llvm-svn: 140334 --- clang/lib/CodeGen/CGClass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen') diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index 59d5ef78599..a831ebda84b 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -573,7 +573,8 @@ static void EmitMemberInitializer(CodeGenFunction &CGF, llvm::Value *ArrayIndexVar = 0; const ConstantArrayType *Array = CGF.getContext().getAsConstantArrayType(FieldType); - if (Array && Constructor->isCopyOrMoveConstructor()) { + if (Array && Constructor->isImplicitlyDefined() && + Constructor->isCopyOrMoveConstructor()) { llvm::Type *SizeTy = CGF.ConvertType(CGF.getContext().getSizeType()); -- cgit v1.2.3