[Issue 21206] New: ICE when argument or return value is string type in extern(C++) functions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 28 16:06:22 UTC 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 at puremagic.com
Reporter: naydef at 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.
--
More information about the Digitalmars-d-bugs
mailing list