aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r--lib/CodeGen/CGCXX.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index 4b8e733f4d..9e20530711 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -295,9 +295,11 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
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()));
}