Bug 14022 – [CTFE] postblits/destructors not called on static array field assignment

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-21T14:51:00Z
Last change time
2015-01-25T00:11:42Z
Keywords
CTFE, pull
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2015-01-21T14:51:33Z
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 }
Comment #1 by k.hara.pg — 2015-01-24T07:49:06Z
Comment #2 by github-bugzilla — 2015-01-25T00:11:40Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/045ed4677f38b8d1e42d5153a9bd68855ffab212 fix Issue 14022 - [CTFE] postblits/destructors not called on static array field assignment https://github.com/D-Programming-Language/dmd/commit/f96ab68fb1530b9a9684d7a62fb59ba3ee90aa00 Merge pull request #4329 from 9rnsr/fix_ctfe Issue 14022 & 14023 - [CTFE] postblits/destructors not called on static array assignment