1 // { dg-do compile } 2 3 // Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu> 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 foo()18foo () { 19 return typename Outer<T>::Inner(); 20 } 21 f()22void f() { 23 foo<int>(); 24 } 25