Fix for part 1 of issue 424.

Yet another difference between static arrays and vectors. Initializing a static
array with one element is handled especially. This fix adds the same handling for
vector types.
This commit is contained in:
kai
2013-07-04 08:06:09 +02:00
parent 5c1b4104d5
commit a2f7246c49

View File

@@ -1022,6 +1022,10 @@ Initializer *ExpInitializer::semantic(Scope *sc, Type *t, NeedInterpret needInte
// Look for the case of statically initializing an array
// with a single member.
#if IN_LLVM
// Fix for part 1 of issue 424.
if (tb->ty == Tvector) tb = static_cast<TypeVector *>(tb)->basetype;
#endif
if (tb->ty == Tsarray &&
!tb->nextOf()->equals(ti->toBasetype()->nextOf()) &&
exp->implicitConvTo(tb->nextOf())