[Issue 13932] New: c++ mangling for template negative int parameter
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jan 4 05:52:56 PST 2015
https://issues.dlang.org/show_bug.cgi?id=13932
Issue ID: 13932
Summary: c++ mangling for template negative int parameter
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Keywords: link-failure
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: schveiguy at yahoo.com
When linking with C++ code that uses a negative integer as a template
parameter, D will fail to link because it outputs e.g. '-1' instead of 'n1' as
required by ABI.
Example:
C++:
template <int x> struct S
{
int member;
};
void func(S<-1> s) {}
D:
struct S(int x)
{
int member;
}
extern(C++) void func(S!(-1) s);
void main()
{
func(S!(-1)(0));
}
result:
Undefined symbols for architecture x86_64:
"__Z4func1SILi-1EE", referenced from:
__Dmain in testcpp1.o
I don't know what platforms other than OSX this causes a problem on.
I am working on a pull that fixes this, will post soon.
--
More information about the Digitalmars-d-bugs
mailing list