This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
template template parameter bug
- To: "egcs-bugs at cygnus dot com" <egcs-bugs at cygnus dot com>
- Subject: template template parameter bug
- From: Thomas Kunert <kunert at physik dot tu-dresden dot de>
- Date: Tue, 19 Jan 1999 13:16:19 +0100
- Organization: TU Dresden
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)