This is similar to #12397 and I'd imagine the same fix will apply to both, but the test case is different enough that it warrants a new issue.
---
immutable C L = 1 << K;
---
Here's the ICE with backtrace.
ctfeice.d:2: error: undefined identifier C
ctfeice.d:2: error: undefined identifier K
cc1d: ../../gcc/d/dfrontend/interpret.c:314: static int CompiledCtfeFunction::walkAllVars(Expression*, void*): Assertion `0' failed.
cc1d: internal compiler error: Aborted
0xa9f00f crash_signal
../../gcc/toplev.c:337
0x606ed4 CompiledCtfeFunction::walkAllVars(Expression*, void*)
../../gcc/d/dfrontend/interpret.c:314
0x5862b7 BinExp::apply(int (*)(Expression*, void*), void*)
../../gcc/d/dfrontend/apply.c:68
0x609352 CompiledCtfeFunction::onExpression(Expression*)
../../gcc/d/dfrontend/interpret.c:298
0x609352 Expression::ctfeInterpret()
../../gcc/d/dfrontend/interpret.c:707
0x600dde ExpInitializer::semantic(Scope*, Type*, NeedInterpret)
../../gcc/d/dfrontend/init.c:828
0x5bee67 VarDeclaration::semantic(Scope*)
../../gcc/d/dfrontend/declaration.c:1489
0x58ac0c AttribDeclaration::semanticNewSc(Scope*, unsigned long, LINK, PROT, int, unsigned int)
../../gcc/d/dfrontend/attrib.c:141
0x58ad38 StorageClassDeclaration::semantic(Scope*)
../../gcc/d/dfrontend/attrib.c:462
0x6411ac Module::semantic()
../../gcc/d/dfrontend/module.c:744
Comment #1 by ibuclaw — 2014-06-01T17:13:45Z
And what happens when DMD runs the code:
ctfeice.d(2): Error: undefined identifier C
ctfeice.d(2): Error: undefined identifier K
dmd: interpret.c:310: static int CompiledCtfeFunction::walkAllVars(Expression*, void*): Assertion `0' failed.
Aborted