| 1 |
// { dg-do assemble } |
| 2 |
|
| 3 |
template<class T> |
| 4 |
struct Foo { }; |
| 5 |
|
| 6 |
template<class T1, class T2> |
| 7 |
struct BT { }; |
| 8 |
|
| 9 |
template<class T1, class T2> |
| 10 |
struct BT< Foo<T1>, Foo<T2> > { static const int i = 1; }; |
| 11 |
|
| 12 |
template<class T1, class T2> |
| 13 |
struct BT< T1, Foo<T2> > { static const int i = 2; }; |
| 14 |
|
| 15 |
template<class T1, class T2> |
| 16 |
struct BT< Foo<T1>, T2 > { static const int i = 3; }; |
| 17 |
|
| 18 |
template<class T1, class T2> |
| 19 |
int foo(Foo<T1>, Foo<T2>) |
| 20 |
{ |
| 21 |
return 1; |
| 22 |
} |
| 23 |
|
| 24 |
template<class T1, class T2> |
| 25 |
int foo(T1, Foo<T2>) |
| 26 |
{ |
| 27 |
return 2; |
| 28 |
} |
| 29 |
|
| 30 |
template<class T1, class T2> |
| 31 |
int foo(Foo<T1>, T2) |
| 32 |
{ |
| 33 |
return 3; |
| 34 |
} |
| 35 |
|
| 36 |
void f() |
| 37 |
{ |
| 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); |
| 44 |
} |