[Issue 17845] New: [ICE] backend\cgcod.c 1677 static foreach
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Sep 21 07:51:02 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=17845
Issue ID: 17845
Summary: [ICE] backend\cgcod.c 1677 static foreach
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: critical
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: mrsmith33 at yandex.ru
---
void main()
{
struct Row
{
@Column!Row((ref Row r, scope SinkT s){ s("test"); })
uint fileSize;
}
auto formatters = parseRowInfo!Row;
}
alias SinkT = void delegate(const(char)[]);
alias Formatter(Row) = void delegate(ref Row row, scope SinkT sink);
struct Column(Row)
{
Formatter!Row formatter;
}
Formatter!Row[] parseRowInfo(Row)()
{
import std.traits;
Formatter!Row[] formatters;
static foreach(member; getSymbolsByUDA!(Row, Column!Row))
{
formatters ~= getUDAs!(member, Column!Row)[0].formatter;
}
return formatters;
}
---
This is reduced case. I was trying to make this work without static in foreach,
but adding static crashed the compiler.
Win10 DMD 2.076
Doesn't crash on dpaste though.
--
More information about the Digitalmars-d-bugs
mailing list