← Back to index
|
Original Bugzilla link
Bug 11534 – [CTFE] inout + returning a pointer into a member array
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-17T01:49:00Z
Last change time
2014-01-21T17:40:53Z
Keywords
CTFE, pull, rejects-valid
Assigned to
nobody
Creator
dmitry.olsh
Comments
Comment #0
by dmitry.olsh — 2013-11-17T01:49:04Z
Somewhat reduced test case: struct MultiArray { this(size_t[] sizes...) { storage = new size_t[5]; } @property auto raw_ptr()inout //removing inout helps { return storage.ptr+1; } size_t[] storage; } enum test = (){ auto m = MultiArray(3,2,1); auto start = m.raw_ptr; //this trigger the bug //auto start = m.storage.ptr + 1; //this obviously works return 0; }(); Output: bug_ctfe.d(17): Error: cannot cast [0u, 0u, 0u, 0u, 0u][1] to uint* at compile time
Comment #1
by k.hara.pg — 2013-11-17T06:02:42Z
https://github.com/D-Programming-Language/dmd/pull/2800
Comment #2
by github-bugzilla — 2013-11-17T07:30:00Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/8c1f04de181505031e2c3d60e933e8a2dbbb4fc8
fix Issue 11534 - [CTFE] inout + returning a pointer into a member array
https://github.com/D-Programming-Language/dmd/commit/66535891ffa9897e99ff9a2bb830e01d7688b87e
Merge pull request #2800 from 9rnsr/fix11534 Issue 11534 - [CTFE] inout + returning a pointer into a member array
Comment #3
by k.hara.pg — 2014-01-21T17:40:53Z
*** Issue 11958 has been marked as a duplicate of this issue. ***