[Issue 2206] unnamed template mixin of class inside function or class has incorrect classinfo and mangleof

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 9 07:58:59 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2206


kamm-removethis at incasoftware.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch




------- Comment #2 from kamm-removethis at incasoftware.de  2008-07-09 09:58 -------
Adding the following override for TemplateMixin::mangle seems to have fixed the
issue in LLVMDC:

--
char *TemplateMixin::mangle()
{
    OutBuffer buf;
    char *id;

#if 0
    printf("TemplateMixin::mangle() %s", toChars());
    if (parent)
        printf("  parent = %s %s", parent->kind(), parent->toChars());
    printf("\n");
#endif
    id = ident ? ident->toChars() : toChars();
// use parent instead of tempdecl->parent here
    if (parent)
    {
        char *p = parent->mangle();
        if (p[0] == '_' && p[1] == 'D')
            p += 2;
        buf.writestring(p);
    }
    buf.printf("%"PRIuSIZE"%s", strlen(id), id);
    id = buf.toChars();
    buf.data = NULL;
    //printf("TemplateMixin::mangle() %s = %s\n", toChars(), id);
    return id;
}
--


-- 



More information about the Digitalmars-d-bugs mailing list