From 16847dd5d5f98feea2e069d20388e2399ea188f6 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sun, 2 Sep 2012 20:56:44 +0200 Subject: [PATCH] Disregard modifiers when checking for initializer type match. Previously, only const'ness was dropped, but DMD 2.060 started to emit initializers with incompatible shared modifiers as well. --- gen/llvmhelpers.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 87854689..15283c77 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -1461,7 +1461,7 @@ static LLConstant* expand_to_sarray(Type *base, Expression* exp) TypeSArray* tsa = static_cast(t); dims.push_back(tsa->dim->toInteger()); assert(t->nextOf()); - t = t->nextOf()->toBasetype(); + t = stripModifiers(t->nextOf()->toBasetype()); } size_t i = dims.size(); @@ -1482,8 +1482,8 @@ static LLConstant* expand_to_sarray(Type *base, Expression* exp) LLConstant* DtoConstExpInit(Loc loc, Type* type, Expression* exp) { #if DMDV2 - Type* expbase = exp->type->toBasetype()->mutableOf()->merge(); - Type* base = type->toBasetype()->mutableOf()->merge(); + Type* expbase = stripModifiers(exp->type->toBasetype())->merge(); + Type* base = stripModifiers(type->toBasetype())->merge(); #else Type* expbase = exp->type->toBasetype(); Type* base = type->toBasetype();