FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / spec17.C
blob3e3dd63751a4b13c038dabe7f95625082d12b0e5
1 // Build don't link:
3 template<class T>
4 struct Foo { };
6 template<class T1, class T2>
7 struct BT { };
9 template<class T1, class T2>
10 struct BT< Foo<T1>, Foo<T2> > { static const int i = 1; };
12 template<class T1, class T2>
13 struct BT< T1, Foo<T2> > { static const int i = 2; };
15 template<class T1, class T2>
16 struct BT< Foo<T1>, T2 > { static const int i = 3; };
18 template<class T1, class T2>
19 int foo(Foo<T1>, Foo<T2>)
21   return 1;
24 template<class T1, class T2>
25 int foo(T1, Foo<T2>)
27   return 2;
30 template<class T1, class T2>
31 int foo(Foo<T1>, T2)
33   return 3;
36 void f()
38   BT< double, Foo<int> >::i;
39   BT< Foo<int>, Foo<int> >::i;
40   BT< Foo<int>, float >::i;
41   foo(1.0, Foo<int>());
42   foo(Foo<int>(), Foo<int>());
43   foo(Foo<int>(), 1.0);