Bug 4569 – extern(c++) doesn't understand const types, produces bad mangled symbol

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-02T00:53:00Z
Last change time
2010-08-02T17:53:21Z
Keywords
patch
Assigned to
nobody
Creator
braddr

Comments

Comment #0 by braddr — 2010-08-02T00:53:37Z
diff --git a/src/cppmangle.c b/src/cppmangle.c index 7023614..9ed6ff3 100644 --- a/src/cppmangle.c +++ b/src/cppmangle.c @@ -198,6 +198,9 @@ void TypeBasic::toCppMangle(OutBuffer *buf, CppMangleState *cms) * u <source-name> # vendor extended type */ + if (isConst()) + buf->writeByte('K'); + switch (ty) { case Tvoid: c = 'v'; break; test case, foo.d: extern(C++) void foo(const char *); void bar(){ foo(""); } $ dmd -c foo.d $ nm foo.o | grep foo U _Z3fooPc With the fix: U _Z3fooPKc $ echo _Z3fooPc | c++filt foo(char*) $ echo _Z3fooPKc | c++filt foo(char const*)
Comment #1 by bugzilla — 2010-08-02T17:53:21Z