[Issue 19953] extern(C++) const ref to static array incorrectly adds const to the mangle name

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 11 16:51:18 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19953

kinke at gmx.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke at gmx.net

--- Comment #1 from kinke at gmx.net ---
The `const` in the D signature doesn't apply to the reference itself, but to
the type, i.e., is the same as `ref const(int[291][6])`, and as such your C++
example isn't an analogon.

Proper analogon with a 1D array, showing that the problem goes somewhat deeper:

C++:          short test27(const int (&)[291]);
Win64 mangle: ?test27@@YAFAEAY0BCD@$$CBH at Z

D:            extern(C++) short test27(const ref int[291])
Win64 mangle: ?test27@@YAFAEBY0BCD at H@Z

--


More information about the Digitalmars-d-bugs mailing list