D issues are now
tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Summary: |
ICE(template.c:4017): instantiating invalid tuple template. D1 only. |
Product: |
D
|
Reporter: |
nfxjfg |
Component: |
dmd | Assignee: |
No Owner <nobody> |
Status: |
RESOLVED
DUPLICATE
|
Severity: |
regression
|
CC: |
clugdbug, leandro.lucarella, robert
|
Priority: |
P2
|
Keywords: |
ice-on-invalid-code |
Version: |
D1 (retired) |
Hardware: |
Other |
OS: |
All |
The following (invalid) code produces an ICE:
void foo(T...)() {
return "";
}
void main() {
foo!(int, char)();
}
dmd: template.c:4017: Identifier* TemplateInstance::genIdent(): Assertion `0' failed.
The 'return "";' is invalid code, because it's inside a function with void as return type. (That's a recent change to dmd.) Apparently, instead of printing a proper error message, something goes wrong.
Interestingly, the example above works when you change it to 'foo!(int)();', and dmd will print what looks like a proper error message.
This is a regression between 1.036 and 1.041. It's nothing to do with return values: any error inside a tuple template will do it:
void foo(T...)() {
bug;
}
void main() {
foo!(int, char)();
}
On DMD1.041, this produced:
Assertion failure: 'i < parameters->dim' on line 796 in file 'template.c'
Comment 2
Robert Clipsham
2009年11月07日 07:54:22 UTC
I believe this is a duplicate of bugzilla #1144.
*** This issue has been marked as a duplicate of issue 1144 ***
What? issue 1144 is marked as fixed, but this bug is triggered in the newest release, even if this is just the symptom of another known bug as Don said.
*** This issue has been marked as a duplicate of issue 2229 ***