This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

template template parameter bug


Hi!

EGCS refuses to compile the following code. At point #3 it insists on
calling the second f #2 and complains about wrong number of template
arguments. I want it to call #1.

Thomas

//*****************************************

template<class A>
class H{};

template <class T>
void f( const T& ){}                      // #1

template< template<class, class> class X, 
	class A, class B>
void f( const X<A,B> & x )                // #2
{}

int main()
{
    H<int> h;
    f(h);                                 // #3
}

//******************************************

[root@ptpp09 opm]# g++ h.cc
h.cc: In function `int main()':
h.cc:16: wrong number of template arguments (2, should be 1)
h.cc:8: provided for `template <class, class> X<A, B>'

[root@ptpp09 opm]# g++ -v
Reading specs from /opt/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.93.01/specs
gcc version egcs-2.93.01 19990116 (gcc2 ss-980609 experimental)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]