← Back to index
|
Original Bugzilla link
Bug 5859 – Declaration inside if condition doesn't call destructor
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-04-18T20:31:00Z
Last change time
2011-06-04T11:40:23Z
Assigned to
nobody
Creator
k.hara.pg
Attachments
ID
Filename
Summary
Content-Type
Size
947
test.d
test cases.
application/octet-stream
2253
Comments
Comment #0
by k.hara.pg — 2011-04-18T20:31:44Z
Test code: ---- import std.stdio; struct S { ~this(){ writeln("S.dtor"); } bool opCast(T:bool)(){ return true; } } void main() { if (auto s = S()) { // s.~this is not called. } else assert(0); } ----
Comment #1
by k.hara.pg — 2011-04-22T04:17:09Z
Created attachment 947 test cases.
Comment #2
by bugzilla — 2011-06-04T11:40:23Z
See:
https://github.com/9rnsr/dmd/commit/5f11cd1ce43b43562f88f05b8bedc3c382db56b5
https://github.com/D-Programming-Language/dmd/commit/e35d337d42525fdd4deaffa327fd8da3083baa37