Skip to content

Commit

Permalink
Merge pull request #3642 from 9rnsr/fix12397
Browse files Browse the repository at this point in the history
Issue 12397 - CTFE ICE CompiledCtfeFunction::walkAllVars with 2.065
  • Loading branch information
ibuclaw committed Jun 7, 2014
2 parents fe06bf7 + 484bdfc commit ccc7892
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/enum.c
Expand Up @@ -604,6 +604,8 @@ void EnumMember::semantic(Scope *sc)
e = e->semantic(sc);
e = resolveProperties(sc, e);
e = e->ctfeInterpret();
if (e->op == TOKerror)
goto Lerrors;
if (first && !ed->memtype && !ed->isAnonymous())
{
ed->memtype = e->type;
Expand Down
16 changes: 16 additions & 0 deletions test/fail_compilation/ice12397.d
@@ -0,0 +1,16 @@
/*
TEST_OUTPUT:
---
fail_compilation/ice12397.d(12): Error: undefined identifier tokenLookup
---
*/

struct DSplitter
{
enum Token : int
{
max = tokenLookup.length
}

immutable string[Token.max] tokenText;
}
9 changes: 9 additions & 0 deletions test/fail_compilation/ice12836.d
@@ -0,0 +1,9 @@
/*
TEST_OUTPUT:
---
fail_compilation/ice12836.d(9): Error: undefined identifier C
fail_compilation/ice12836.d(9): Error: undefined identifier K
---
*/

immutable C L = 1 << K;

0 comments on commit ccc7892

Please sign in to comment.