www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21799] New: CTFE doesn't call base class destructor for

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

          Issue ID: 21799
           Summary: CTFE doesn't call base class destructor for extern(D)
                    classes
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: moonlightsentinel disroot.org

CTFE only calls the first destructor and skips base class dtors.
Test case that fails during CTFE:

int testDeleteDScope()
{
    char[] res;
    {
        scope cd = new ChildD();
        cd.ptr = &res;
    }

    assert(res == "BA", cast(string) res);
    return 0;
}

--
Apr 05