summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/friend15.C
blob: 15ba1c271822a8c4b93a69195d13c6cda241b3a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { dg-do compile }

// Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>

// PR c++/9453
// Access checking when template friend is defined in class.

template <typename> class X {
  private:
    struct Inner;

    template <typename R>
    friend typename X<R>::Inner * foo (X<R>*) { return 0; }
};
template class X<void>;
X<void>* p;

struct U {
  void bar () { foo (p); }
};