Compiling the following code will result in an ICE:
extern(C++) void foo(string a) {}
Error: Internal Compiler Error: unsupported type string
The same happens with other D specific types that don't exist in C++. Like delegates and associative arrays. I'm pretty sure that the ICE comes from the C++ mangler. The compiler should give a proper error, that the type is not supported for C++ functions, before getting to the mangler.
Comment #1 by b2.temp — 2019-03-25T11:58:00Z
*** Issue 19759 has been marked as a duplicate of this issue. ***
Comment #2 by dlang-bot — 2019-03-25T12:44:22Z
@Basile-z created dlang/dmd pull request #9488 "fix issue 16575 - extern(C++) function with D specific types" fixing this issue:
- fix issue 16575 - extern(C++) function with D specific types
https://github.com/dlang/dmd/pull/9488
Comment #3 by b2.temp — 2019-07-16T20:59:03Z
*** Issue 16772 has been marked as a duplicate of this issue. ***
Comment #4 by b2.temp — 2019-12-12T19:09:24Z
*** Issue 20427 has been marked as a duplicate of this issue. ***
Comment #5 by ibuclaw — 2022-05-13T15:42:45Z
*** Issue 21206 has been marked as a duplicate of this issue. ***
Comment #6 by ibuclaw — 2022-05-13T15:43:35Z
*** Issue 21314 has been marked as a duplicate of this issue. ***
Comment #7 by dlang-bot — 2022-05-13T18:28:12Z
@ibuclaw created dlang/dmd pull request #14125 "fix Issue 16575 - [ICE] extern(C++) function with D specific types" fixing this issue:
- fix Issue 16575 - [ICE] extern(C++) function with D specific types
https://github.com/dlang/dmd/pull/14125
Comment #8 by dlang-bot — 2022-05-16T10:53:40Z
dlang/dmd pull request #14125 "fix Issue 16575 - [ICE] extern(C++) function with D specific types" was merged into master:
- e4970f259beceb4d2ea11e2ad7a9524acbe1febc by Iain Buclaw:
fix Issue 16575 - [ICE] extern(C++) function with D specific types
https://github.com/dlang/dmd/pull/14125