Another regression in DMD 2.059 Git (7c22b8a) compared to D 2.058:
---
struct A {
static if (__traits(derivedMembers, A).length) {}
}
---
The reason is quite obvious from the backtrace, DMD recurses infinitely while trying to get the list of members even if the static if doesn't add members:
---
#0 0x001e70ec in TraitsExp::semantic (this=0xbf800288, sc=0x352000) at traits.c:77
#1 0x000be883 in UnaExp::semantic (this=0x426d00, sc=0x681b70) at expression.c:5844
#2 0x000e1d54 in DotIdExp::semantic (this=0x426d00, sc=0x681b70, flag=0) at expression.c:6450
#3 0x000c0520 in DotIdExp::semantic (this=0x426d00, sc=0x681b70) at expression.c:6382
#4 0x0007e78d in StaticIfCondition::include (this=0x426d20, sc=0x681b70, s=0x0) at cond.c:257
#5 0x000071d2 in ConditionalDeclaration::include (this=0x426d60, sc=0x681ac0, sd=0x0) at attrib.c:1242
#6 0x0008b92a in ScopeDsymbol::foreach (sc=0x681ac0, members=0x426bc0, dg=0x1e9630 <_ZZN9TraitsExp8semanticEP5ScopeEN12PushIdentsDg2dgEPvmP7Dsymbol>, ctx=0x681b50, pn=0x0) at dsymbol.c:1148
.
.
.
---
Comment #1 by github-bugzilla — 2012-04-10T19:05:47Z