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.
Comment #1 by r.sagitario — 2012-11-30T01:40:00Z
There's been no mangling at all so far. https://github.com/D-Programming-Language/dmd/pull/1338
Comment #2 by github-bugzilla — 2012-12-01T22:28:56Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/23d3b452cd88cc5b9eb373014b8566d595aa2bf7 Merge pull request #1338 from rainers/win64_cpp_mangle fix issue 9093: C++ symbol mangling for Win64