[dmd-internals] DMC vs DMD C++ mangling

Daniel Murphy yebblies at gmail.com
Thu Apr 18 06:22:24 PDT 2013


Hi all,

I have come across one strange case where dmd and dmc produce different
mangling for seemingly identical declarations.

D:
extern(C++) const(const(bool)*) gc_pi1; // mangled as ?gc_pi1@@3PB_NB

C++:
extern bool const * const gc_pi1; // mangled as ?gc_pi1@@3QB_NB

So we have '[PQ]B_NB' which translates to '[pointer/const pointer] const
bool const' where both of the const modifiers (for some reason) apply to
the bool, not the pointer.

Is dmd incorrectly printing 'P' instead of 'Q' or have I missed something?

Thanks,
Daniel.

PS If anybody with msvc installed could try this I would be very grateful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20130418/f3f905c9/attachment.html>


More information about the dmd-internals mailing list