Bug 1026 – dmd SEGV when checking length of Tuple elements when length == 0
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2007-03-05T13:39:00Z
Last change time
2014-02-16T15:24:17Z
Assigned to
bugzilla
Creator
webmaster
Comments
Comment #0 by webmaster — 2007-03-05T13:39:12Z
The following code segfaults dmd 1.007 on Linux:
template Tuple(Elements...) {
alias Elements Tuple;
}
struct foo {
Tuple!() elements;
}
static assert(foo.elements.length == 0);
Comment #1 by webmaster — 2007-03-05T17:53:53Z
Turns out that it SEGVs also when the Tuple is not empty:
template Tuple(Elements...) {
alias Elements Tuple;
}
struct bar {}
struct foo {
Tuple!(bar) elements;
}
static assert(foo.elements.length == 1);
Comment #2 by webmaster — 2007-03-06T20:34:08Z
The following (nonsense) code also causes a SEGV:
template Tuple(Elements...) {
alias Elements Tuple;
}
struct foo {
Tuple!() elements;
}
static assert(foo.elements[0]);