Mercurial > projects > ldc
diff dmd/interpret.c @ 913:29c0d1194033
Fix #198 and #199 by making CTFE on static struct initializers work.
Renamed SymbolDeclaration to StaticStructInitDeclaration to make its usage clearer.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 01 Feb 2009 20:20:56 +0100 |
parents | 330f999ade44 |
children | b30fe7e1dbb9 |
line wrap: on
line diff
--- a/dmd/interpret.c Fri Jan 30 07:51:50 2009 +0100 +++ b/dmd/interpret.c Sun Feb 01 20:20:56 2009 +0100 @@ -987,7 +987,7 @@ { Expression *e = EXP_CANT_INTERPRET; VarDeclaration *v = d->isVarDeclaration(); - SymbolDeclaration *s = d->isSymbolDeclaration(); + StaticStructInitDeclaration *s = d->isStaticStructInitDeclaration(); if (v) { #if DMDV2 @@ -1011,11 +1011,9 @@ } else if (s) { - if (s->dsym->toInitializer() == s->sym) - { Expressions *exps = new Expressions(); - e = new StructLiteralExp(0, s->dsym, exps); - e = e->semantic(NULL); - } + Expressions *exps = new Expressions(); + e = new StructLiteralExp(0, s->dsym, exps); + e = e->semantic(NULL); } return e; } @@ -1466,10 +1464,10 @@ if (v->value && v->value->op == TOKvar) { VarExp *ve2 = (VarExp *)v->value; - if (ve2->var->isSymbolDeclaration()) + if (ve2->var->isStaticStructInitDeclaration()) { /* This can happen if v is a struct initialized to - * 0 using an __initZ SymbolDeclaration from + * 0 using an StaticStructInitDeclaration from * TypeStruct::defaultInit() */ }