[Issue 13921] New: ICE with template instantiation error
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Jan 1 04:32:28 PST 2015
https://issues.dlang.org/show_bug.cgi?id=13921
Issue ID: 13921
Summary: ICE with template instantiation error
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: ice-on-invalid-code
Severity: regression
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: sinkuupump at gmail.com
Compiler crashes with the code below.
This is introduced in https://github.com/D-Programming-Language/dmd/pull/4091
Code:
struct S(N)
{
void fun()
{
undefined_identifier;
// or anything that makes the instantiation fail
}
}
void test(T)(S!T)
{
}
void main()
{
S!string g;
test(g);
}
Output:
% dmd | head -n1
DMD64 D Compiler v2.067-devel-60bdb8c
% dmd -c test.d
test.d(5): Error: undefined identifier undefined_identifier
test.d(16): Error: template instance test.S!string error instantiating
dmd: template.c:2621: FuncDeclaration*
TemplateDeclaration::doHeaderInstantiation(TemplateInstance*, Scope*,
FuncDeclaration*, Type*, Expressions*): Assertion `fd->type->ty != Tfunction'
failed.
--
More information about the Digitalmars-d-bugs
mailing list