Bug 5923 – (D1 only) .ptr property is not const for const arrays

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2011-05-03T04:24:48Z
Last change time
2018-10-19T05:33:37Z
Assigned to
No Owner
Creator
Mathias Baumann

Attachments

IDFilenameSummaryContent-TypeSize
958main.dtestcaseapplication/octet-stream271

Comments

Comment #0 by mathias.baumann — 2011-05-03T04:24:48Z
Created attachment 958 testcase see the attached testcase. the &var[0] syntax works while the var.ptr syntax fails.
Comment #1 by andrej.mitrovich — 2013-01-11T20:04:40Z
You'll have to change: const S test1[4] = [ S(1), S(2)]; to const S test1[2] = [ S(1), S(2)]; to avoid runtime errors (lengths don't match for array copy). But otherwise this seems to be fixed.
Comment #2 by andrej.mitrovich — 2013-01-11T20:05:00Z
Dumb me, this is D1, not D2, sorry.
Comment #3 by pro.mathias.lang — 2018-10-19T05:33:37Z
Since D1 is long gone, and nowadays you have this check in D2, I'm going to close this.