From 646679fd44fe69bb7f55e036da9d96aba9ad9efc Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sun, 10 Aug 2008 10:40:26 +0200 Subject: [PATCH] Make struct literals work with typedefs. Fixes run/s/struct_initialization_13_A and run/t/typedef_20_A --- gen/toir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index 08aa2426..2b763a9a 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -2172,7 +2172,7 @@ DValue* StructLiteralExp::toElem(IRState* p) // default init the struct to take care of padding // and unspecified members - TypeStruct* ts = (TypeStruct*)type; + TypeStruct* ts = (TypeStruct*)type->toBasetype(); assert(ts->sym); DtoForceConstInitDsymbol(ts->sym); assert(ts->sym->ir.irStruct->init);