digitalmars.D.bugs - [Issue 14092] New: C++ mangling for struct nested inside same class
- via Digitalmars-d-bugs (55/55) Jan 31 2015 https://issues.dlang.org/show_bug.cgi?id=14092
https://issues.dlang.org/show_bug.cgi?id=14092 Issue ID: 14092 Summary: C++ mangling for struct nested inside same class as static function is broken when in namespace Product: D Version: D2 Hardware: x86_64 OS: Mac OS X Status: NEW Severity: normal Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: coldencullen gmail.com 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. --
Jan 31 2015