January 31, 2015 [Issue 14092] New: C++ mangling for struct nested inside same class as static function is broken when in namespace | ||||
---|---|---|---|---|
| ||||
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. -- |
Copyright © 1999-2021 by the D Language Foundation