...and aggregate POD types.

llvm-svn: 72676
This commit is contained in:
Anders Carlsson 2009-05-31 21:12:26 +00:00
parent 60d0c2c1c2
commit 96c012ff8b
2 changed files with 9 additions and 4 deletions

View File

@ -299,10 +299,8 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
Builder.CreateStore(EmitScalarExpr(Init), NewPtr); Builder.CreateStore(EmitScalarExpr(Init), NewPtr);
else if (AllocType->isAnyComplexType()) else if (AllocType->isAnyComplexType())
EmitComplexExprIntoAddr(Init, NewPtr, AllocType.isVolatileQualified()); EmitComplexExprIntoAddr(Init, NewPtr, AllocType.isVolatileQualified());
else { else
ErrorUnsupported(E, "new expression"); EmitAggExpr(Init, NewPtr, AllocType.isVolatileQualified());
return llvm::UndefValue::get(ConvertType(E->getType()));
}
} }
return NewPtr; return NewPtr;

View File

@ -11,8 +11,15 @@ void t2(int* a) {
int* b = new (a) int; int* b = new (a) int;
} }
struct S {
int a;
};
void t3() { void t3() {
int *a = new int(10); int *a = new int(10);
_Complex int* b = new _Complex int(10i); _Complex int* b = new _Complex int(10i);
S s;
s.a = 10;
S *sp = new S(s);
} }