www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20223] New: C++, POSIX: Wrong mangling for const reference of

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

          Issue ID: 20223
           Summary: C++, POSIX: Wrong mangling for const reference of
                    callback
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: pro.mathias.lang gmail.com

```
extern(C++) public int foo(T)(int function(const(T)* value));
extern(C++) public int bar(T)(int function(ref const(T) value));
```

The first one gets mangled as `_Z3fooIiEiPFiPKT_E`, as it should.
The second one gets mangled as:
`_Z3barIiEiPFiRT_E` instead of
`_Z3barIiEiPFiRKT_E`.

--
Sep 17 2019