Bug 12689 – [CTFE] assigning via pointer from 'in' expression doesn't work

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-01T19:23:00Z
Last change time
2014-05-03T17:52:07Z
Keywords
CTFE, wrong-code
Assigned to
nobody
Creator
nilsbossung

Comments

Comment #0 by nilsbossung — 2014-05-01T19:23:01Z
Works with 2.057 and earlier. --- cat > test.d << code static int g() { int[int] aa; aa[1] = 13; assert(*(1 in aa) == 13); /* passes */ *(1 in aa) = 42; /* no effect in CTFE */ return aa[1]; } void main() { assert(g() == 42); enum e = g(); assert(e == 42); /* fails */ assert(e != 13); /* fails */ } code rdmd test.d --- core.exception.AssertError@test(13): Assertion failure ---
Comment #1 by k.hara.pg — 2014-05-03T16:38:02Z
Comment #2 by github-bugzilla — 2014-05-03T17:52:07Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ce9cab42156bcda2ce78f273338e2fa4b296f4dc fix Issue 12689 - [CTFE] assigning via pointer from 'in' expression doesn't work https://github.com/D-Programming-Language/dmd/commit/b223603af62845631a1ab8eda3c8c496aee1768c Merge pull request #3521 from 9rnsr/fix12689 Issue 12689 - [CTFE] assigning via pointer from 'in' expression doesn't work