Bug 3044 – Segfault(template.c) instantiating struct tuple constructor with zero arguments.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-06-01T12:22:00Z
Last change time
2015-06-09T01:27:57Z
Keywords
ice-on-valid-code, patch
Assigned to
bugzilla
Creator
sean
Comments
Comment #0 by sean — 2009-06-01T12:22:29Z
import std.typecons;
void fn(T)( T val )
{
T* tmp = new T;
}
void main()
{
fn( tuple(5) );
}
Comment #1 by clugdbug — 2009-06-02T17:12:40Z
Applies on all platforms. Segfaulting in template.c 854
Reduced test case shows it's caused by a tuple this() struct constructor.
struct Foo {
this(U...)(U values) { }
}
void main(){
new Foo;
}
Segfaulting in template.c (854)
nfargs = fargs->dim; // number of function arguments
PATCH: template.c(854)
if (!fargs) nfargs=0;
else nfargs = fargs->dim; // number of function arguments