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
8template <class T> class Outer {
9  private:
10    struct Inner {};
11
12    template <class T_>
13    friend typename Outer<T_>::Inner foo ();
14};
15
16template <class T>
17typename Outer<T>::Inner
18foo () {
19  return typename Outer<T>::Inner();
20}
21
22void f() {
23  foo<int>();
24}
25