gcc/testsuite/g++.dg/template/friend12.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | // Origin: Wolfgang Bangerth <[email protected]> |
| 4 | |
| 5 | // PR 9030. Perform access checking to parameter and return type of |
| 6 | // function template correctly when the template is friend. |
| 7 | |
| 8 | template <class T> class Outer { |
| 9 | private: |
| 10 | struct Inner {}; |
| 11 | |
| 12 | template <class T_> |
| 13 | friend typename Outer<T_>::Inner foo (); |
| 14 | }; |
| 15 | |
| 16 | template <class T> |
| 17 | typename Outer<T>::Inner |
| 18 | foo () { |
| 19 | return typename Outer<T>::Inner(); |
| 20 | } |
| 21 | |
| 22 | void f() { |
| 23 | foo<int>(); |
| 24 | } |