2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / template25.C
blob5e876d9957a197882ec094b604421e300b34e4e4
1 // { dg-do run  }
2 // PRMS Id: 6393
3 // Bug: g++ is too lax in considering UPTs to be the same.
5 template <class R, class T>
6 class Bar
8 public:
9   R do_bar (T arg);
13 template <class T>
14 class Foo
16   T i;
18 public:
19   void do_foo () {}
20   void do_foo (T const & t) {}
21   void do_foo (Bar<char, T> const & bar);  // {} Put the body here and it works
22   void do_foo (Bar<T, T> const & bar);     // {} Put the body here and it works
25 // These definitions don't work
27 template <class T>
28 inline void Foo<T>::
29 do_foo (Bar<char, T> const & bar)
32 template <class T>
33 inline void Foo<T>::
34 do_foo (Bar<T, T> const & bar)
38 int main ()
39 { int i;
40   Bar<char, int> bar1;
41   Bar<int, int>  bar2;
42   Foo<int> foo;
43   foo.do_foo();
44   foo.do_foo(i);
45   foo.do_foo(bar1);
46   foo.do_foo(bar2);
48   return 0;