diff ir/irtypestruct.cpp @ 1632:8c37dcd7cfde

Allow unions with void-initialized members.
author Matti Niemenmaa <matti.niemenmaa+hg@iki.fi>
date Sun, 13 Sep 2009 22:15:33 +0300
parents 72f00d740665
children
line wrap: on
line diff
--- a/ir/irtypestruct.cpp	Tue Feb 09 13:53:13 2010 +0100
+++ b/ir/irtypestruct.cpp	Sun Sep 13 22:15:33 2009 +0300
@@ -2,6 +2,7 @@
 
 #include "aggregate.h"
 #include "declaration.h"
+#include "init.h"
 #include "mtype.h"
 
 #include "gen/irstate.h"
@@ -94,7 +95,7 @@
     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());