Bug 2311 – Static destructors in templates are never run

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2008-08-24T07:00:00Z
Last change time
2014-03-01T00:37:00Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2008-08-24T07:00:11Z
The assertion in the following code never fires: template X() { static ~this() { assert (false); } } void main() { alias X!() x; } Changing the destructor to a constructor makes it work.
Comment #1 by matti.niemenmaa+dbugzilla — 2008-09-03T01:20:55Z
Fixed in DMD 1.035.
Comment #2 by bugzilla — 2008-09-03T01:37:24Z
Fixed dmd 1.035 and 2.019