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

Issue 2246

Summary: Regression(2.046, 1.061): Specialization of template to template containing int arguments fails
Product: D Reporter: Fawzi Mohamed <fawzi>
Component: dmdAssignee: No Owner <nobody>
Status: RESOLVED FIXED
Severity: regression CC: bugzilla, clugdbug, k.hara.pg
Priority: P2 Keywords: patch, rejects-valid
Version: D1 (retired)
Hardware: All
OS: All

Description Fawzi Mohamed 2008年07月25日 08:30:21 UTC
{{{
class A(T,d){
 T p;
}
class B(int rk){
 int[rk] p;
}
class C(T,int rk){
 T[rk] p;
}
template f(T:A!(U,d),U,d){
 void f(){ }
}
template f(T:B!(rank),int rank){
 void f(){ }
}
template f(T:C!(U,rank),U,int rank){
 void f(){ }
}
void main(){
 A!(int,long) a;
 B!(2) b;
 C!(int,2) c;
 f!(A!(int,long))();
 f!(B!(2))();
 f!(C!(int,2))();
}
}}}
fails on 
 f!(B!(2))();
and
 f!(C!(int,2))();
{{{
Line 30: template instance f!(B) does not match any template declaration
Line 30: Error: template instance 'f!(B)' is not a variable
Line 30: Error: function expected before (), not f!(B) of type int
}}}
also GDC, and (i suspect) newer DMD releases have this problem 
Fawzi
Comment 1 Fawzi Mohamed 2008年07月25日 12:05:27 UTC
I think (I did not try all possibilities, but most) that this extends to any non type arguments.
Comment 2 Don 2010年11月26日 01:16:51 UTC
The code actually worked for a long time, but was broken again in 2.046. Possibly caused by the bugfix for bug 945.
Comment 3 Kenji Hara 2011年08月04日 12:51:32 UTC
D2 patch:
https://github.com/D-Programming-Language/dmd/pull/293 

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