gcc/testsuite/g++.dg/template/friend55.C
raw| 1 | // PR c++/59956 |
| 2 | |
| 3 | template <int I> struct A; |
| 4 | template <int I> class B { |
| 5 | int i; |
| 6 | template <int A_S> friend void A<A_S>::impl(); |
| 7 | }; |
| 8 | |
| 9 | B<0> b1; |
| 10 | template<int I>struct A { void impl(); }; |
| 11 | B<1> b2; |
| 12 | |
| 13 | template<int I> void A<I>::impl() { ++b1.i; ++b2.i; } |
| 14 | |
| 15 | int main() |
| 16 | { |
| 17 | A<0>().impl(); |
| 18 | } |