Skip to content

Commit

Permalink
Merge pull request #2144 from donc/ice10283ctfestructlit
Browse files Browse the repository at this point in the history
10283: ICE in CTFE
  • Loading branch information
9rnsr committed Jun 7, 2013
2 parents ba281ae + c00056d commit 7ca1fe6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cast.c
Expand Up @@ -1065,7 +1065,7 @@ Expression *Expression::castTo(Scope *sc, Type *t)
VarDeclaration *v = ((VarExp *)this)->var->isVarDeclaration();
if (v && v->storage_class & STCmanifest)
{
Expression *e = optimize(WANTvalue | WANTinterpret);
Expression *e = ctfeInterpret();
return e->castTo(sc, t);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/expression.c
Expand Up @@ -4588,6 +4588,8 @@ Expression *StructLiteralExp::semantic(Scope *sc)
}
offset = v->offset + v->type->size();
}
if (e && e->op == TOKerror)
return e;
elements->push(e);
}

Expand Down
10 changes: 10 additions & 0 deletions test/fail_compilation/ice10283.d
@@ -0,0 +1,10 @@
// 10283

S10283 blah(S10283 xxx) { return xxx; }
S10283 repy = blah(S10283());

struct S10283
{
string source = 7;
}

0 comments on commit 7ca1fe6

Please sign in to comment.