[Issue 18888] New: extern(C++) template arg/alias arg mangling issue
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sun May 20 23:56:12 UTC 2018
    
    
  
https://issues.dlang.org/show_bug.cgi?id=18888
          Issue ID: 18888
           Summary: extern(C++) template arg/alias arg mangling issue
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: turkeyman at gmail.com
This C++ code:
------------------------------------------
template <typename T>
struct TemplateName
{
        void fun() {}
};
template <template<typename> typename blah = TemplateName>
struct Str
{
        using I = TemplateName<blah<int>>;
};
Str<>::I s;
------------------------------------------
Produces the symbol:
?fun@?$TemplateName at U?$TemplateName at H@@@@QEAAXXZ
The equivalent D code makes a mistake with the alias argument:
------------------------------------------
extern (C++)
struct TemplateName(T)
{
        void fun();
}
extern (C++)
struct Str(alias blah = TemplateName)
{
        alias I = TemplateName!(blah!int);
}
pragma(msg, Str!().I.fun.mangleof);
------------------------------------------
Prints:
?fun@?$TemplateName at U?$blah at H@@@@QEAAXXZ
Notice that the name of the alias parameter `blah` ends up in there, rather
than the template it is an alias of?
--
    
    
More information about the Digitalmars-d-bugs
mailing list