Bug 20429 – extern(C++) mangling of multiple const ref params
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-12-04T15:17:43Z
Last change time
2019-12-04T16:36:45Z
Assigned to
No Owner
Creator
John Colvin
Comments
Comment #0 by john.loughran.colvin — 2019-12-04T15:17:43Z
extern(C++, blah):
struct S {}
void foo(ref const(S) s0, ref const(S) s1);
pragma(msg, foo.mangleof);
void bar(ref const(S) s0, const(S) s1);
pragma(msg, foo.mangleof);
The foo and bar are mangled the same, and in both s1 is not mangled as ref, but s0 is.
Comment #1 by john.loughran.colvin — 2019-12-04T15:19:57Z
sorry, my mistake, ignore
Comment #2 by kinke — 2019-12-04T16:19:57Z
I can reproduce this, after fixing your pragma(mangle) (using `foo` twice). The `bar` Itanium mangling is fine (with/without namespace), but `foo` is off - `_ZN4blah3fooERKNS_1SES1_` (DMD frontend) vs. `_ZN4blah3fooERKNS_1SES2_` (gcc, https://cpp.godbolt.org/z/j9sZdM). Haven't checked MSVC mangling.