Bug 20427 – Bad parameter types in C++ functions should not issue Internal Compiler Errors

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-12-03T03:42:49Z
Last change time
2020-03-21T03:56:36Z
Assigned to
No Owner
Creator
Andrej Mitrovic

Comments

Comment #0 by andrej.mitrovich — 2019-12-03T03:42:49Z
``` extern(C++) void test(ubyte[]) {} void main() { } ``` test.d(1): Error: Internal Compiler Error: type `ubyte[]` can not be mapped to C++ As far as I recall, the user should never see ICEs. The above should just be a regular error message. In addition to this, it doesn't work great with templates. For example: ``` extern(C++) void test(T)(T) {} void main() { test([1, 2]); } ``` > test.d(1): Error: Internal Compiler Error: type `int[]` can not be mapped to C++ The error doesn't show the instantiation line test.d(5), making it hard to track down where the bad instantiation comes from.
Comment #1 by b2.temp — 2019-12-12T19:09:24Z
There's an orphan PR for 16575 that someone can revive. *** This issue has been marked as a duplicate of issue 16575 ***