[Issue 14023] New: [CTFE] postblits/destructors not called on static array index assignment
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Jan 21 06:59:17 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14023
Issue ID: 14023
Summary: [CTFE] postblits/destructors not called on static
array index assignment
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: CTFE
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: k.hara.pg at gmail.com
int test()
{
int cpctor, dtor;
struct S
{
this(this) { cpctor++; }
~this() { dtor++; }
}
S[3] sa;
S[3][] arr = [[S(), S(), S()]];
assert(cpctor == 0 && dtor == 0);
arr[0] = sa;
assert(cpctor == 3 && dtor == 3);
return 1;
}
//static assert(test()); // ctfe -> fails
void main()
{
test(); // runtime -> ok
}
--
More information about the Digitalmars-d-bugs
mailing list