mirror of
https://github.com/intel/llvm.git
synced 2026-02-01 00:46:45 +08:00
Revert the hack Chris Lattner added in r97981 to work around
brokenness in the designated-initializer ASTs. The ASTs were fixed by Alp Toker's patch (r116098) for PR6955. Fixes PR6537. llvm-svn: 116101
This commit is contained in:
@@ -562,16 +562,6 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
|
||||
unsigned NumInitElements = E->getNumInits();
|
||||
RecordDecl *SD = E->getType()->getAs<RecordType>()->getDecl();
|
||||
|
||||
// If we're initializing the whole aggregate, just do it in place.
|
||||
// FIXME: This is a hack around an AST bug (PR6537).
|
||||
if (NumInitElements == 1 && E->getType() == E->getInit(0)->getType()) {
|
||||
EmitInitializationToLValue(E->getInit(0),
|
||||
CGF.MakeAddrLValue(DestPtr, E->getType()),
|
||||
E->getType());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (E->getType()->isUnionType()) {
|
||||
// Only initialize one field of a union. The field itself is
|
||||
// specified by the initializer list.
|
||||
|
||||
Reference in New Issue
Block a user