<div dir="ltr"><div style>Hi all,</div><div><br></div>I have come across one strange case where dmd and dmc produce different mangling for seemingly identical declarations.<div><br></div><div style>D:</div><div style>extern(C++) const(const(bool)*) gc_pi1; // mangled as ?gc_pi1@@3PB_NB<br>
</div><div style><br></div><div style>C++:</div><div style>extern bool const * const gc_pi1; // mangled as ?gc_pi1@@3QB_NB<br></div><div style><br></div><div style>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.</div>
<div style><br></div><div style>Is dmd incorrectly printing 'P' instead of 'Q' or have I missed something?</div><div style><br></div><div style>Thanks,</div><div style>Daniel.</div><div style><br></div><div style>
PS If anybody with msvc installed could try this I would be very grateful.</div></div>