| 1 |
// { dg-do assemble } |
| 2 |
// Origin: Gabriel Dos Reis <[email protected]> |
| 3 |
|
| 4 |
// Bug 29. We failed to verify that template argument deduction |
| 5 |
// produces a valid result in nondeduce context. |
| 6 |
|
| 7 |
template<class T> struct Y { typedef T X; }; |
| 8 |
|
| 9 |
template<class T, class U> struct Base {}; |
| 10 |
|
| 11 |
template<class T> struct Base<T, typename T::X> {}; |
| 12 |
|
| 13 |
template<class T> struct Base<typename T::X, T> {}; |
| 14 |
|
| 15 |
template<class T, class U> struct Derived : Base <T, U> {}; |
| 16 |
|
| 17 |
struct A {}; |
| 18 |
|
| 19 |
template<class T> struct Derived<A, T> : Base< Y<T>, Y<T> > {}; |
| 20 |
|
| 21 |
int main() |
| 22 |
{ |
| 23 |
Derived<A, int> d; |
| 24 |
} |