[Issue 14022] New: [CTFE] postblits/destructors not called on static array field assignment
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Jan 21 06:51:33 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14022
Issue ID: 14022
Summary: [CTFE] postblits/destructors not called on static
array field 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++; }
}
struct T
{
S[3] member;
}
S[3] sa;
T t;
assert(cpctor == 0 && dtor == 0);
t.member = 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