www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14650] New: Destructors are not called on global variables

https://issues.dlang.org/show_bug.cgi?id=14650

          Issue ID: 14650
           Summary: Destructors are not called on global variables
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: verylonglogin.reg gmail.com

This program works fine but shouldn't:
---
struct S
{ ~this() { assert(0); } }

S s;

void main() { }
---

Destructors on global variables should be either prohibited or correctly
called.


Note:
This issue was introduced by fixing Issue 6364. See Issue 6364, comment 2.

--
Jun 04 2015