Support for complex types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72675 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index 4b8e733..9e20530 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -295,9 +295,11 @@
const Expr *Init = E->getConstructorArg(0);
- if (!hasAggregateLLVMType(AllocType)) {
+ if (!hasAggregateLLVMType(AllocType))
Builder.CreateStore(EmitScalarExpr(Init), NewPtr);
- } else {
+ else if (AllocType->isAnyComplexType())
+ EmitComplexExprIntoAddr(Init, NewPtr, AllocType.isVolatileQualified());
+ else {
ErrorUnsupported(E, "new expression");
return llvm::UndefValue::get(ConvertType(E->getType()));
}