gcc/testsuite/g++.dg/template/friend13.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | // Perform access checking to parameter and return type of |
| 4 | // function template correctly when only specialization is friend. |
| 5 | |
| 6 | template <class T> |
| 7 | typename T::Inner |
| 8 | foo () { |
| 9 | return typename T::Inner(); |
| 10 | } |
| 11 | |
| 12 | class Outer { |
| 13 | private: |
| 14 | struct Inner {}; |
| 15 | |
| 16 | friend Outer::Inner foo<Outer> (); |
| 17 | }; |
| 18 | |
| 19 | void f() { |
| 20 | foo<Outer>(); |
| 21 | } |