Bug 10198 – CTFE: Wrong code for multi-dimensional block assignment
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-29T00:45:00Z
Last change time
2015-06-09T05:11:53Z
Keywords
CTFE, wrong-code
Assigned to
nobody
Creator
clugdbug
Comments
Comment #0 by clugdbug — 2013-05-29T00:45:35Z
This code fails. Currently only val[0][] is initialized, the reset remains with the default initializer.
---
struct MultiBlock {
int val[3][4];
}
int multiblockTest()
{
MultiBlock pp = MultiBlock(67);
assert(pp.val[2][3] == 67);
assert(pp.val[1][3] == 67);
return 1;
}
static assert(multiblockTest());
---
Additionally, the wrong behaviour is coded into a test in the test suite, in test42.d.