[Issue 15473] C++ mangling problem

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Jan 2 02:04:16 PST 2016


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

--- Comment #3 from Manu <turkeyman at gmail.com> ---
Here's another case:

C++:
 
?CreateImplInternal at Component@ep@@IEAAPEAXU?$BaseString at D@2 at U?$SharedMap at U?$AVLTree at UVariant@ep@@U12 at U?$Compare at UVariant@ep@@@2@@ep@@@2@@Z

D:
 
?CreateImplInternal at Component@ep@@IEAAPEAXU?$BaseString at D@2 at U?$SharedMap at U?$AVLTree at UVariant@ep@@0U?$Compare at UVariant@ep@@@2@@ep@@@2@@Z

The difference being that same little '0U' which is meant to be 'U12 at U' again.


C++ declaration:

namespace ep {
  class Component : public RefCounted, public IComponent
  {
    void* CreateImplInternal(String ComponentType, Variant::VarMap initParams);
  };
}

D declaration:

extern (C++, ep) class Component : RefCounted, IComponent
{
  void* CreateImplInternal(String componentType, Variant.VarMap initParams);
}


In both cases, the function involves, Variant::VarMap, which expands to:

  C++: ep::SharedMap<ep::AVLTree<ep::Variant, ep::Variant,
ep::Compare<ep::Variant>>>
  D: SharedMap!(AVLTree!(Variant, Variant, Compare!Variant))

That's the same type as the return value in the first issue, with the same
problem in the symbol name.
This is a pretty long symbol name, but the missing 'U12@' seems deterministic.

--


More information about the Digitalmars-d-bugs mailing list