https://issues.dlang.org/show_bug.cgi?id=21927
Issue ID: 21927
Summary: ICE (illegal instruction) with static foreach over
empty member template
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: ice
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
//////////////// test.d ///////////////
struct S
{
template tpl()
{
}
void fun()
{
static foreach (p; this.tpl!())
{
}
}
}
///////////////////////////////////////
Compilation fails with:
be = '.' this.tpl!() at [test.d(9)]
[1] 3724069 illegal hardware instruction (core dumped) dmd -o- test.d
For whatever reason, the "this." is important.
--