mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-14 20:03:14 +01:00
Merged DMD commit b9d6cf886404091fd03445c064a17f6332e16f0d:
bugzilla 4866 Static-to-dynamic converted manifest constant array gets non-converted type in static/constraint if
This commit is contained in:
@@ -1206,20 +1206,31 @@ void VarDeclaration::semantic(Scope *sc)
|
||||
}
|
||||
else if (ei)
|
||||
{
|
||||
e = e->optimize(WANTvalue | WANTinterpret);
|
||||
if (e->op == TOKint64 || e->op == TOKstring || e->op == TOKfloat64)
|
||||
{
|
||||
ei->exp = e; // no errors, keep result
|
||||
}
|
||||
#if DMDV2
|
||||
if (isDataseg() || (storage_class & STCmanifest))
|
||||
e = e->optimize(WANTvalue | WANTinterpret);
|
||||
else
|
||||
e = e->optimize(WANTvalue);
|
||||
switch (e->op)
|
||||
{
|
||||
/* Save scope for later use, to try again
|
||||
*/
|
||||
scope = new Scope(*sc);
|
||||
scope->setNoFree();
|
||||
}
|
||||
case TOKint64:
|
||||
case TOKfloat64:
|
||||
case TOKstring:
|
||||
case TOKarrayliteral:
|
||||
case TOKassocarrayliteral:
|
||||
case TOKstructliteral:
|
||||
case TOKnull:
|
||||
ei->exp = e; // no errors, keep result
|
||||
break;
|
||||
|
||||
default:
|
||||
#if DMDV2
|
||||
/* Save scope for later use, to try again
|
||||
*/
|
||||
scope = new Scope(*sc);
|
||||
scope->setNoFree();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
init = i2; // no errors, keep result
|
||||
|
||||
Reference in New Issue
Block a user