mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-21 07:13:13 +01:00
Merged DMD commit 59d0f4b13384d656fdb66b2dc25c26e6b4cfa1ac:
bugzilla 4768 Regression(1.056): wrong code with forward declaration of enum
This commit is contained in:
12
dmd/mtype.c
12
dmd/mtype.c
@@ -4294,6 +4294,18 @@ Expression *TypeEnum::defaultInit(Loc loc)
|
||||
|
||||
int TypeEnum::isZeroInit(Loc loc)
|
||||
{
|
||||
if (!sym->isdone && sym->scope)
|
||||
{ // Enum is forward referenced. We need to resolve the whole thing.
|
||||
sym->semantic(NULL);
|
||||
}
|
||||
if (!sym->isdone)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
printf("3: ");
|
||||
#endif
|
||||
error(loc, "enum %s is forward referenced", sym->toChars());
|
||||
return 0;
|
||||
}
|
||||
return (sym->defaultval == 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user