1119 – Internal error: ../ztc/cgcod.c 2190 (template instantiation)

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1119 - Internal error: ../ztc/cgcod.c 2190 (template instantiation)
Summary: Internal error: ../ztc/cgcod.c 2190 (template instantiation)
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: Other All
: P2 critical
Assignee: Walter Bright
URL: http://www.core-dump.com.hr/vebtree.d
Keywords: ice-on-valid-code
Depends on:
Blocks:
Reported: 2007年04月10日 05:53 UTC by Zeljko Vrba
Modified: 2014年02月16日 15:23 UTC (History)
0 users

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 Zeljko Vrba 2007年04月10日 05:53:01 UTC
At 2007年04月09日 I have downloaded the DMD package from the digitalmars web-page. I tried to code a veb-tree with template metaprogramming and ended up with the above-mentioned error. The command-line was /opt/dmd/bin/dmd -c vebtree.d
The complete code can be found at the above URL.
Comment 1 Zeljko Vrba 2007年04月10日 05:55:09 UTC
(In reply to comment #0)
>
> The complete code can be found at the above URL.
> 
Ah, the URL: http://www.core-dump.com.hr/vebtree.d 
Comment 2 Matti Niemenmaa 2007年04月10日 12:38:36 UTC
Reduced version:
import std.intrinsic;
private class Node(uint level, uint nlog)
{
 Node!(level-1, nlog/2) bottom;
}
private class Node(uint level : 0, uint nlog : 5)
{
 uint leaf;
 uint min()
 {
	return leaf == 0 ? 0 : bsf(leaf);
 }
}
alias Node!(2, 20) tree;
Comment 3 Jari-Matti Mäkelä 2007年04月10日 13:35:43 UTC
(In reply to comment #2)
Hehe, I created a bit more reduced version on #d today, but forgot to post it here. Here it is:
import std.intrinsic;
class Node(int l) { Node!(l-1) b; }
class Node(int l : 0) {
 uint leaf = 0;
 int m() {
	return leaf ? 0 : bsf(leaf);
 }
}
alias Node!(1) tree;
Comment 4 Walter Bright 2007年04月20日 13:19:27 UTC
Fixed DMD 1.013


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