[Issue 18198] New: @disable semantic not applied for the delete operator

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 5 21:55:22 UTC 2018


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

          Issue ID: 18198
           Summary: @disable semantic not applied for the delete operator
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com

---
class Foo
{
    @disable delete(void*){}
}

void main()
{
    Foo foo = new Foo;
    delete foo;
}
---

is accepted, but not 

---
class Foo
{
    @disable new (size_t){return null;}
}

void main()
{
    Foo foo = new Foo;
    delete foo;
}
---

there should be a symmetry between "@disable new" and "@disable delete"

--


More information about the Digitalmars-d-bugs mailing list