Bug 2246 – Regression(2.046, 1.061): Specialization of template to template containing int arguments fails

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2008-07-25T08:30:00Z
Last change time
2014-02-24T15:32:58Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
fawzi

Comments

Comment #0 by fawzi — 2008-07-25T08:30:21Z
{{{ 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 by fawzi — 2008-07-25T12:05:27Z
I think (I did not try all possibilities, but most) that this extends to any non type arguments.
Comment #2 by clugdbug — 2010-11-26T01:16:51Z
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 by k.hara.pg — 2011-08-04T12:51:32Z
Comment #4 by bugzilla — 2011-08-04T22:59:24Z
Comment #5 by bugzilla — 2011-08-06T00:01:15Z