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.
This commit is contained in:
David Nadlinger 2012-09-02 20:56:44 +02:00
parent 8987f2da30
commit 16847dd5d5

View file

@ -1461,7 +1461,7 @@ static LLConstant* expand_to_sarray(Type *base, Expression* exp)
TypeSArray* tsa = static_cast<TypeSArray*>(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();