www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18198] New: disable semantic not applied for the delete

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 puremagic.com
          Reporter: b2.temp 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"

--
Jan 05