www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14536] New: Calling destroy() on a on an extern(C++) class

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

          Issue ID: 14536
           Summary: Calling destroy() on a on an extern(C++) class causes
                    a segfault
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: devw0rp gmail.com

class Foo{}
extern(C++) class Bar{}

void main() {
    destroy(new Foo()); // Works fine
    destroy(new Bar()); // segfault!
}

Calling destroy() on a class marked extern(C++) will segfault. Either it should
work and not segfault, or trying to call destroy in this way should result in a
compile time error.

--
May 02 2015