D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.

Issue 3482

Summary: ICE(template.c:4017): instantiating invalid tuple template. D1 only.
Product: D Reporter: nfxjfg
Component: dmdAssignee: 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

Description nfxjfg 2009年11月06日 16:17:39 UTC
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.
Comment 1 Don 2009年11月06日 23:35:18 UTC
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 ***
Comment 3 nfxjfg 2009年11月07日 21:29:41 UTC
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.
Comment 4 Don 2009年11月07日 22:43:31 UTC
*** This issue has been marked as a duplicate of issue 2229 ***

AltStyle によって変換されたページ (->オリジナル) /