Allow unions with void-initialized members.

This commit is contained in:
Matti Niemenmaa
2009-09-13 22:15:33 +03:00
parent 645a9d1229
commit e53b6a20f3

View File

@@ -2,6 +2,7 @@
#include "aggregate.h"
#include "declaration.h"
#include "init.h"
#include "mtype.h"
#include "gen/irstate.h"
@@ -94,7 +95,7 @@ const llvm::Type* IrTypeStruct::buildType()
for (; field_it.more(); field_it.next())
{
// init is !null for explicit inits
if (field_it->init != NULL)
if (field_it->init != NULL && !field_it->init->isVoidInitializer())
{
IF_LOG Logger::println("adding explicit initializer for struct field %s",
field_it->toChars());