Thread overview
[Issue 21412] betterC mode program with C++ interface/class crashes
3 days ago
Adam D. Ruppe
3 days ago
https://issues.dlang.org/show_bug.cgi?id=21412

Dibyendu Majumdar <mobile@majumdar.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |betterC, C++

--- Comment #1 from Dibyendu Majumdar <mobile@majumdar.org.uk> ---
According to documentation betterC mode supports:

Interfacing with C++
COM classes and C++ classes

--
3 days ago
https://issues.dlang.org/show_bug.cgi?id=21412

--- Comment #2 from Dibyendu Majumdar <mobile@majumdar.org.uk> ---
I tried with / without

@disable this();

Same result

--
3 days ago
https://issues.dlang.org/show_bug.cgi?id=21412

Adam D. Ruppe <destructionator@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator@gmail.com

--- Comment #3 from Adam D. Ruppe <destructionator@gmail.com> ---
that's just an ordinary null pointer.....

--
3 days ago
https://issues.dlang.org/show_bug.cgi?id=21412

--- Comment #4 from Dibyendu Majumdar <mobile@majumdar.org.uk> ---
I assume you mean that it needs to be coded like this?

import core.stdc.stdio : printf;

extern (C++) abstract class A {
    void sayHello();
}

extern (C++) class B : A {
    override void sayHello() {
        printf("hello\n");
    }
}

extern (C) void main() {
    scope b = new B;
    b.sayHello();
}

This works

--
3 days ago
https://issues.dlang.org/show_bug.cgi?id=21412

Dibyendu Majumdar <mobile@majumdar.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--