[Issue 4059] New: Incorrect C++ name mangling

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Apr 3 14:08:16 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4059

           Summary: Incorrect C++ name mangling
           Product: D
           Version: 2.041
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: robert at octarineparrot.com


--- Comment #0 from Robert Clipsham <robert at octarineparrot.com> 2010-04-03 22:08:14 BST ---
b.cpp:
----
struct elem { };
void foobar(elem*, elem*) {}
----
a.d:
----
struct elem { }
extern(C++)void foobar(elem*, elem*);
void main(){
        elem *a;
        foobar(a, a);
}
----
Compile with:
$ gcc -c b.cpp -ob.o
$ dmd a.d b.o
This gives linking errors, as dmd does not mangle foobar properly. According to
nm, the correct mangle (found in b.cpp) is:
_Z6foobarP4elem
But dmd mangles it as:
_Z6foobarP4elemS_

Again, this is a blocker for ddmd on linux.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list