forked from OSchip/llvm-project
parent
60d0c2c1c2
commit
96c012ff8b
|
@ -299,10 +299,8 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
|
|||
Builder.CreateStore(EmitScalarExpr(Init), NewPtr);
|
||||
else if (AllocType->isAnyComplexType())
|
||||
EmitComplexExprIntoAddr(Init, NewPtr, AllocType.isVolatileQualified());
|
||||
else {
|
||||
ErrorUnsupported(E, "new expression");
|
||||
return llvm::UndefValue::get(ConvertType(E->getType()));
|
||||
}
|
||||
else
|
||||
EmitAggExpr(Init, NewPtr, AllocType.isVolatileQualified());
|
||||
}
|
||||
|
||||
return NewPtr;
|
||||
|
|
|
@ -11,8 +11,15 @@ void t2(int* a) {
|
|||
int* b = new (a) int;
|
||||
}
|
||||
|
||||
struct S {
|
||||
int a;
|
||||
};
|
||||
|
||||
void t3() {
|
||||
int *a = new int(10);
|
||||
_Complex int* b = new _Complex int(10i);
|
||||
|
||||
S s;
|
||||
s.a = 10;
|
||||
S *sp = new S(s);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue