Bug 9093 – Overloads in extern(C++) interfaces throw up COMDAT errors
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2012-11-28T08:58:00Z
Last change time
2012-12-09T13:31:12Z
Keywords
patch
Assigned to
nobody
Creator
gooberman
Comments
Comment #0 by gooberman — 2012-11-28T08:58:22Z
Fairly simple description - create an interface that externs to C++ with a couple of overloads. Create a class that implements that interface. COMDAT has an error with defining multiple symbols as a result.
Sample code:
extern (C++) interface ICameraLens
{
float NearPlane();
float NearPlane(float p);
}
class NewCameraLens : ICameraLens
{
extern (C++) float NearPlane() { return 0; }
extern (C++) float NearPlane(float p) { return 0; }
}
Compiling with the Win64 compiler.
Issue originally was found when working with properties; however, the error occurs on any overloaded extern'd function.