Merged DMD commit 8999f902485d9930332010aeb9db6d44b16bcd4c:

Brad's fix for fail278 regression
This commit is contained in:
David Nadlinger
2011-04-22 18:53:17 +02:00
parent 90621b7680
commit 3e75e7ec08

View File

@@ -216,7 +216,6 @@ char *ClassDeclaration::mangle()
char *TemplateInstance::mangle()
{
OutBuffer buf;
char *id;
#if 0
printf("TemplateInstance::mangle() %s", toChars());
@@ -224,16 +223,19 @@ char *TemplateInstance::mangle()
printf(" parent = %s %s", parent->kind(), parent->toChars());
printf("\n");
#endif
id = ident ? ident->toChars() : toChars();
Dsymbol *par = isnested || isTemplateMixin() ? parent : tempdecl->parent;
char *id = ident ? ident->toChars() : toChars();
if (!tempdecl)
error("is not defined");
else if (par)
else
{
char *p = par->mangle();
if (p[0] == '_' && p[1] == 'D')
p += 2;
buf.writestring(p);
Dsymbol *par = isnested || isTemplateMixin() ? parent : tempdecl->parent;
if (par)
{
char *p = par->mangle();
if (p[0] == '_' && p[1] == 'D')
p += 2;
buf.writestring(p);
}
}
buf.printf("%zu%s", strlen(id), id);
id = buf.toChars();