3482 – ICE(template.c:4017): instantiating invalid tuple template. D1 only.

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3482 - ICE(template.c:4017): instantiating invalid tuple template. D1 only.
Summary: ICE(template.c:4017): instantiating invalid tuple template. D1 only.
Status: RESOLVED DUPLICATE of issue 2229
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: Other All
: P2 regression
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
Reported: 2009年11月06日 16:17 UTC by nfxjfg
Modified: 2014年04月18日 09:12 UTC (History)
3 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
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 によって変換されたページ (->オリジナル) /