Bug 14092 – C++ mangling for struct nested inside same class as static function is broken when in namespace

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2015-01-31T19:41:00Z
Last change time
2015-03-25T03:26:30Z
Keywords
C++
Assigned to
nobody
Creator
coldencullen

Comments

Comment #0 by coldencullen — 2015-01-31T19:41:08Z
On OSX (possibly other platforms, I haven't gotten to check), when a class in a namespace has a static extern(C++) function takes a struct nested inside the same class, the mangling for that struct ignores it's parent class, and just uses the namespace qualifier. Example: C++: --- namespace v8 { class Isolate { public: struct CreateParams { }; static Isolate* New(CreateParams params) { return 0; } }; } --- D: --- extern(C++, v8) { class Isolate { struct CreateParams { } static Isolate New(CreateParams params); } } void main() { auto o1 = Isolate.New( Isolate.CreateParams() ); } --- This results in the following error message: --- Undefined symbols for architecture x86_64: "v8::Isolate::New(v8::CreateParams)", referenced from: __Dmain in run_test.o ld: symbol(s) not found for architecture x86_64 --- It should be looking for "v8::Isolate::New(v8::Isolate::CreateParams)" instead.
Comment #1 by coldencullen — 2015-03-25T03:26:30Z
*** This issue has been marked as a duplicate of issue 13337 ***