gcc/testsuite/g++.dg/template/defarg13.C
raw| 1 | // PR c++/14912 |
| 2 | // Bug: We were instantiating A<B> in order to compare it to the matching |
| 3 | // argument for C<B,B>, which fails. |
| 4 | |
| 5 | template <class T> |
| 6 | struct A |
| 7 | { |
| 8 | typedef typename T::F F; |
| 9 | }; |
| 10 | |
| 11 | struct B { }; |
| 12 | |
| 13 | template <class T, class U = typename A<T>::F > |
| 14 | struct C |
| 15 | { |
| 16 | typename T::F f; // { dg-error "no type" } |
| 17 | }; |
| 18 | |
| 19 | C<B, B> c; // { dg-message "required" } |