[Issue 21213] New: preview=dtorfields with strict attributes in base class constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 31 15:06:31 UTC 2020


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

          Issue ID: 21213
           Summary: preview=dtorfields with strict attributes in base
                    class constructor
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: moonlightsentinel at disroot.org

The following test case doesn't compile with `-preview=dtorfields`:

===================================================

class Parent
{
    this() nothrow pure @nogc @safe {}
}

class Child : Parent
{
    S s;
    // this() {} // Uncomment this to make the test pass
}

struct S
{
    ~this() {}
}

===================================================

onlineapp.d(6): Error: `pure` constructor `onlineapp.Child.this` cannot call
impure destructor `onlineapp.Child.~this`
onlineapp.d(6): Error: `@safe` constructor `onlineapp.Child.this` cannot call
`@system` destructor `onlineapp.Child.~this`
onlineapp.d(6):        `onlineapp.Child.~this` is declared here
onlineapp.d(6): Error: `@nogc` constructor `onlineapp.Child.this` cannot call
non- at nogc destructor `onlineapp.Child.~this`

--


More information about the Digitalmars-d-bugs mailing list