From e53b6a20f33c2a2b6a11d946556103504cbce6c8 Mon Sep 17 00:00:00 2001 From: Matti Niemenmaa Date: Sun, 13 Sep 2009 22:15:33 +0300 Subject: [PATCH] Allow unions with void-initialized members. --- ir/irtypestruct.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ir/irtypestruct.cpp b/ir/irtypestruct.cpp index ab63acf9..926a1e0e 100644 --- a/ir/irtypestruct.cpp +++ b/ir/irtypestruct.cpp @@ -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());