Bug 20336 – Regression (2.088.1) C++ mangling problem with multiple const ref parameters
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2019-10-30T03:25:52Z
Last change time
2019-11-01T06:51:55Z
Assigned to
No Owner
Creator
Andrej Mitrovic
Comments
Comment #0 by andrej.mitrovich — 2019-10-30T03:25:52Z
cpp.cpp:
-----
struct Value { };
void one (Value const& a)
{
}
void two (Value const& a, Value const& b)
{
}
-----
test.d:
-----
struct Value { }
extern(C++) void one(ref const(Value) a);
extern(C++) void two(ref const(Value) a, ref const(Value) b);
void main ()
{
Value value;
one(value);
two(value, value); // linker error with 2.088.1
}
-----
2.088.1:
-----
$ g++ -c -g -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 cpp.cpp
$ rdmd --force -L-lstdc++ -vcolumns cpp.o test.d
Undefined symbols for architecture x86_64:
"two(Value const&, Value const)", referenced from:
__Dmain in test.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: linker exited with status 1
-----
Works ok with 2.088.0
Comment #1 by andrej.mitrovich — 2019-10-30T03:27:27Z
It looks like the `ref` is gone in the mangling of `two`.
Comment #2 by pro.mathias.lang — 2019-11-01T06:51:55Z