diff --git a/dmd/template.c b/dmd/template.c index 62fc13aa..8457a1a5 100644 --- a/dmd/template.c +++ b/dmd/template.c @@ -3875,11 +3875,7 @@ TemplateDeclaration *TemplateInstance::findTemplateDeclaration(Scope *sc) if (s->parent && (ti = s->parent->isTemplateInstance()) != NULL) { - if ( - (ti->name == id || - ti->toAlias()->ident == id) - && - ti->tempdecl) + if (ti->tempdecl && ti->tempdecl->ident == id) { /* This is so that one can refer to the enclosing * template, even if it has the same name as a member