[Issue 23339] New: Internal Compiler Error with extern(C++) class declared in function template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 17 10:29:00 UTC 2022


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

          Issue ID: 23339
           Summary: Internal Compiler Error with extern(C++) class
                    declared in function template
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: naydef at abv.bg

Code:
----------------------------------
auto HookVFunc(T)(T)
{
    extern(C++) class Delegate
    {
        void dd() {}
    }
}


class SamplePlugin
{
    void Load()
    {
        HookVFunc(&GameFrame);
    }

    void GameFrame()
    {
    }
}
----------------------------------
Error:
source/app.d(5,14): Error: Internal Compiler Error: type `void delegate()`
cannot be mapped to C++
----------------------------------
I'm not very sure if this is supposed to be a valid code(I think it is.)
Marked as regression, because run.dlang.io indicates compile success up to DMD
2.65.0

--


More information about the Digitalmars-d-bugs mailing list