forked from OSchip/llvm-project
parent
454a7cdfb3
commit
9213a6bfa4
|
@ -439,10 +439,9 @@ void AggExprEmitter::EmitArrayInit(llvm::Value *DestPtr, llvm::ArrayType *AType,
|
||||||
// type is an array (or array of array, etc.) of class type.
|
// type is an array (or array of array, etc.) of class type.
|
||||||
Expr *filler = E->getArrayFiller();
|
Expr *filler = E->getArrayFiller();
|
||||||
bool hasTrivialFiller = true;
|
bool hasTrivialFiller = true;
|
||||||
if (CXXConstructExpr *cons = dyn_cast_or_null<CXXConstructExpr>(filler)) {
|
if (CXXConstructExpr *cons = dyn_cast_or_null<CXXConstructExpr>(filler))
|
||||||
assert(cons->getConstructor()->isDefaultConstructor());
|
hasTrivialFiller = cons->getConstructor()->isDefaultConstructor() &&
|
||||||
hasTrivialFiller = cons->getConstructor()->isTrivial();
|
cons->getConstructor()->isTrivial();
|
||||||
}
|
|
||||||
|
|
||||||
// Any remaining elements need to be zero-initialized, possibly
|
// Any remaining elements need to be zero-initialized, possibly
|
||||||
// using the filler expression. We can skip this if the we're
|
// using the filler expression. We can skip this if the we're
|
||||||
|
|
|
@ -448,3 +448,10 @@ namespace DR1070 {
|
||||||
};
|
};
|
||||||
C c = {};
|
C c = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace ArrayOfInitList {
|
||||||
|
struct S {
|
||||||
|
S(std::initializer_list<int>);
|
||||||
|
};
|
||||||
|
S x[1] = {};
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue