Bug 2722 – ICE with variadic template parameters

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-03-10T09:18:00Z
Last change time
2015-06-09T05:15:20Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
andrei

Comments

Comment #0 by andrei — 2009-03-10T09:18:12Z
This code: int foo(Types...)(string a) { } void main() { auto a = foo!(int, double)("s"); } fails with: dmd: template.c:798: MATCH TemplateDeclaration::deduceFunctionTemplateMatch(Loc, Objects*, Expression*, Expressions*, Objects*): Assertion `i < parameters->dim' failed. Adding a return 0; inside foo fixes the problem. The compiler should issue an error message giving information about what went wrong.
Comment #1 by bugzilla — 2009-04-01T13:54:07Z
Fixed DMD 2.027