https://issues.dlang.org/show_bug.cgi?id=18721
Issue ID: 18721 Summary: ICE in dmd/cond.d(378) when compiling static foreach with -D Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: ice, ice-on-valid-code Severity: critical Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: greensunn...@gmail.com >From https://github.com/dlang/phobos/pull/6402 Reduced: > dmd -D --- /// template allSameType() { static foreach (idx; T) enum allSameType ; } --- --- core.exception.AssertError@dmd/cond.d(378): Assertion failure ---------------- ??:? _d_assertp [0x74903d] dmd/cond.d:378 pure nothrow @nogc @safe void dmd.cond.StaticForeach.prepare(dmd.dscope.Scope*).__require() [0x51392f] dmd/cond.d:377 void dmd.cond.StaticForeach.prepare(dmd.dscope.Scope*) [0x5137dc] dmd/attrib.d:1083 _ZN24StaticForeachDeclaration7includeEP5Scope [0x50c2df] dmd/doc.d:1042 _ZN11emitComment11EmitComment5visitEP17AttribDeclaration [0x55811b] dmd/parsetimevisitor.d:75 _ZN16ParseTimeVisitorI10ASTCodegenE5visitEP24StaticForeachDeclaration [0x6437f2] dmd/attrib.d:1143 _ZN24StaticForeachDeclaration6acceptEP7Visitor [0x50c48d] dmd/doc.d:1091 void dmd.doc.emitComment(dmd.dsymbol.Dsymbol, dmd.root.outbuffer.OutBuffer*, dmd.dscope.Scope*) [0x557798] dmd/doc.d:796 void dmd.doc.emitMemberComments(dmd.dsymbol.ScopeDsymbol, dmd.root.outbuffer.OutBuffer*, dmd.dscope.Scope*) [0x55767c] dmd/doc.d:916 _ZN11emitComment11EmitComment4emitEP5ScopeP7DsymbolPKc [0x557c57] dmd/doc.d:960 _ZN11emitComment11EmitComment5visitEP11Declaration [0x557ded] dmd/parsetimevisitor.d:47 _ZN16ParseTimeVisitorI10ASTCodegenE5visitEP16AliasDeclaration [0x643492] dmd/declaration.d:929 _ZN16AliasDeclaration6acceptEP7Visitor [0x535d61] dmd/doc.d:1091 void dmd.doc.emitComment(dmd.dsymbol.Dsymbol, dmd.root.outbuffer.OutBuffer*, dmd.dscope.Scope*) [0x557798] dmd/doc.d:796 void dmd.doc.emitMemberComments(dmd.dsymbol.ScopeDsymbol, dmd.root.outbuffer.OutBuffer*, dmd.dscope.Scope*) [0x55767c] dmd/doc.d:439 _Z10gendocfileP6Module [0x556783] dmd/mars.d:911 int dmd.mars.tryMain(ulong, const(char)**) [0x5f8097] dmd/mars.d:1098 _Dmain [0x5f8d92] --- --