aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/friend55.C
blob: 4abe6ce6a2386188fa44eb68b1364720a4cf96b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/59956

template <int I> struct A;
template <int I> class B {
  int i;
  template <int A_S> friend void A<A_S>::impl();
};

B<0> b1;
template<int I>struct A { void impl(); };
B<1> b2;

template<int I> void A<I>::impl() { ++b1.i; ++b2.i; }

int main()
{
  A<0>().impl();
}