Skip to content

Commit

Permalink
Allow NullExp as struct hidden member in struct literals
Browse files Browse the repository at this point in the history
Since CTFE will create null hidden pointers.
  • Loading branch information
don-clugston-sociomantic committed Jun 7, 2013
1 parent ba281ae commit 1b4a30d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/expression.c
Expand Up @@ -4516,6 +4516,10 @@ Expression *StructLiteralExp::semantic(Scope *sc)
e = resolveProperties(sc, e);
if (i >= nfields)
{
if (i == sd->fields.dim - 1 && sd->isNested() && e->op == TOKnull)
{ // CTFE sometimes creates null as hidden pointer; we'll allow this.
continue;
}
#if 0
for (size_t i = 0; i < sd->fields.dim; i++)
printf("[%d] = %s\n", i, sd->fields[i]->toChars());
Expand Down

0 comments on commit 1b4a30d

Please sign in to comment.