gcc/testsuite/g++.dg/template/deduce9.C
raw| 1 | // PR c++/95888 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template <typename T> class A { |
| 5 | A(int, int); |
| 6 | template <typename> friend class A; |
| 7 | friend T; |
| 8 | }; |
| 9 | |
| 10 | template<typename U> struct B { |
| 11 | template<typename V> struct C { |
| 12 | A<B> begin() { return {1, 0}; } |
| 13 | }; |
| 14 | template<typename Z, int *P = nullptr> |
| 15 | C<Z> fn(); |
| 16 | }; |
| 17 | |
| 18 | int |
| 19 | main () |
| 20 | { |
| 21 | B<int> b; |
| 22 | b.fn<int>().begin(); |
| 23 | } |