← Back to index
|
Original Bugzilla link
Bug 13295 – [CTFE] Modifications of const user type disappear
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-08-15T12:47:00Z
Last change time
2015-01-21T13:49:42Z
Keywords
CTFE, pull, wrong-code
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0
by verylonglogin.reg — 2014-08-15T12:47:37Z
This code should compile fine: --- struct S { int n; } void f(ref const S s) { *cast(int*) &s.n = 1; // assert(s.n == 1); // will also fail } void main() { static assert( { S s; f(s); return s.n == 1; // false, s.n is 0 } ()); } ---
Comment #1
by k.hara.pg — 2015-01-20T15:20:52Z
https://github.com/D-Programming-Language/dmd/pull/4319
Comment #2
by github-bugzilla — 2015-01-21T13:49:41Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/cbb449b63d20ac46faa5c0f79d92cba23b743713
fix Issue 13295 - [CTFE] Modifications of const user type disappear
https://github.com/D-Programming-Language/dmd/commit/fa9a9b834b674656096f69c6273acb2dcf8529b3
Merge pull request #4319 from 9rnsr/fix_ctfe Issue 13295 - [CTFE] Modifications of const user type disappear