August 28, 2020
https://issues.dlang.org/show_bug.cgi?id=21206

          Issue ID: 21206
           Summary: ICE when argument or return value is string type in
                    extern(C++) functions
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: naydef@abv.bg

Code:
----------------------------------
extern(C++) void Foo(string arg) {}

void main() {}
----------------------------------
Error: Internal Compiler Error: type string cannot be mapped to C++
----------------------------------
Both in run.dlang.io and Windows DMD32 v2.93.1 the error is show


The following code:
----------------------------------
import std.stdio;

extern(C++) struct Obj
{
    string toString()
    {
        return "ret";
    }
}

void main()
{
    Obj obj1;
    writefln("%s", obj1);
}
----------------------------------
Generates error only on Windows DMD32 v2.93.1, but not in run.dlang.io.
Adding extern(D) to the toString() fixes the error.

--