www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19248] New: Wrong mangle for C++ const STL classes/structs

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

          Issue ID: 19248
           Summary: Wrong mangle for C++ const STL classes/structs
           Product: D
           Version: D2
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ilyayaroshenko gmail.com

================ C++
namespace std
{
    class vector
    {
    };
}

void bar(std::vector& a)
{

}

void foo(const std::vector& a)
{

}

----------------
_Z3barRSt6vector:
  rep ret

_Z3fooRKSt6vector:
  rep ret

================ D

extern(C++, std)
{
    extern(C++, class) struct vector
    {
    }
}

extern(C++):

void bar(ref std.vector)
{

}

void foo(ref const std.vector)
{

}

----------------
_Z3barRSt6vector: // OK
  ret

_Z3fooRKNSt6vectorE: // Wrong STD shortcuts 
  ret

--
Sep 15 2018