When compiling the following code:
---
template Foo(alias T) {
template Temp() {
const char[] Temp = "int x;";
}
}
mixin(Foo!(1).Temp!());
---
DMD says:
one.d(7): template instance Foo!(1) does not match any template declaration
and then comes the ICE.
Comment #1 by ary — 2008-01-11T19:10:47Z
I think the bug is in expression.c, line 5152:
---
error("template identifier %s is not a member of %s %s", id->toChars(), s->kind(), s->ident->toChars());
---
In this case, s is an instance of TemplateInstance, and so s->ident is null. It should be replaced by:
---
Identifier* id;
if (s->isTemplateInstance()) {
id = s->isTemplateInstance()->name;
} else {
id = s->ident;
}
error("template identifier %s is not a member of %s %s", id->toChars(), s->kind(), id->toChars());
---
Or something similar to that.