Bug 14195 – Ice when mangling templated function parameter extern(C++) function
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2015-02-17T18:38:00Z
Last change time
2017-07-19T17:38:39Z
Keywords
C++, ice
Assigned to
nobody
Creator
code
Comments
Comment #0 by code — 2015-02-17T18:38:28Z
struct Delegate1(T) {}
struct Delegate2(T1, T2) {}
template Signature(T)
{
alias Signature = typeof(*(T.init));
}
alias del1_t = Delegate1!(Signature!(void function()));
alias del2_t = Delegate2!(Signature!(int function(float, double)), Signature!(int function(float, double)));
extern(C++)
{
void DelegateTest1(del1_t);
void DelegateTest2(del2_t);
}
When compiling with the latest dmd from git head on windows this will output:
Error: ICE: Unsupported type void()
Error: ICE: Unsupported type int(float, double)
Error: ICE: Unsupported type int(float, double)
It should mangle the functions as:
static assert(DelegateTest1.mangleof == "?DelegateTest1@@YAXU?$Delegate1@$$A6AXXZ@@@Z");
static assert(DelegateTest2.mangleof == "?DelegateTest2@@YAXU?$Delegate2@$$A6AHMN@Z$$A6AHMN@Z@@@Z");