[Issue 14746] New: Behavior change with struct destructor and alias this

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jun 28 23:06:41 PDT 2015


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

          Issue ID: 14746
           Summary: Behavior change with struct destructor and alias this
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: briancschott at gmail.com

```
import std.stdio;

void main()
{
    Ownership o;
    destroy(o);
}

struct HasADestructor
{
    ~this() {writeln("test");}
}

struct Ownership
{
    HasADestructor* pointer;
    alias pointer this;
}

```

With 2.067.1 this program runs with no output. With 2.068.0-b1 it outputs the
string "test". With both compiler versions simply letting the struct go out of
scope does not result in any output.

--


More information about the Digitalmars-d-bugs mailing list