gcc/testsuite/g++.dg/template/friend15.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | // Origin: Wolfgang Bangerth <[email protected]> |
| 4 | |
| 5 | // PR c++/9453 |
| 6 | // Access checking when template friend is defined in class. |
| 7 | |
| 8 | template <typename> class X { |
| 9 | private: |
| 10 | struct Inner; |
| 11 | |
| 12 | template <typename R> |
| 13 | friend typename X<R>::Inner * foo (X<R>*) { return 0; } |
| 14 | }; |
| 15 | template class X<void>; |
| 16 | X<void>* p; |
| 17 | |
| 18 | struct U { |
| 19 | void bar () { foo (p); } |
| 20 | }; |