https://issues.dlang.org/show_bug.cgi?id=14209
Issue ID: 14209
Summary: Duplicate Comdat with extern(C++)
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
The following code produces a duplicate comdat linker error on windows x64
template Signature(T)
{
alias Signature = typeof(T.init);
}
struct ezDelegate(T)
{
extern(C++) static DispatchDFunction()
{
}
};
extern(C++) void Test1(ezDelegate!(Signature!(void function())) )
{
}
int main()
{
ezDelegate!(Signature!(void function())) test;
return 0;
}
The error message is:
// fatal error LNK1179: invalid or corrupt file: duplicate COMDAT
'?DispatchDFunction@?$ezDelegate@P6AXXZ@@SAXXZ'
Removing any of the "exern(C++)" or the "typeof" will avoid the problem.
--