Bug 8673 – enum z = [0][(()=>$-1)()]; crashes the compiler

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-09-16T18:37:00Z
Last change time
2015-06-09T05:10:43Z
Keywords
CTFE
Assigned to
nobody
Creator
timon.gehr

Comments

Comment #0 by timon.gehr — 2012-09-16T18:37:37Z
DMD 2.060 enum z = [0][(()=>$-1)()]; dmd: interpret.c:153: void CtfeStack::saveGlobalConstant(VarDeclaration*, Expression*): Assertion `v->init && (v->isConst() || v->isImmutable()) && !v->isCTFE()' failed.
Comment #1 by github-bugzilla — 2012-09-23T20:57:14Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ddcde35249c6c780422e11aa4ac965523f58aaea Fix issue 8673 enum z = [0][(()=>$-1)()]; crashes the compiler variables with CTFE storage class shouldn't be treated as globals. (__dollar is a funny hack, it's neither global nor local). https://github.com/D-Programming-Language/dmd/commit/8f47d6113c8538131397ea2f68547ba2d859efb2 Merge pull request #1127 from donc/ice8673ctfe_dollar Fix issue 8673 enum z = [0][(()=>$-1)()]; crashes the compiler